properly wait to fill in the start date
This commit is contained in:
parent
aab411fcca
commit
c61f7ac590
6
nzz.js
6
nzz.js
@ -14,9 +14,9 @@ const yargs = require("yargs/yargs");
|
|||||||
const { hideBin } = require("yargs/helpers");
|
const { hideBin } = require("yargs/helpers");
|
||||||
|
|
||||||
const URL = "https://zeitungsarchiv.nzz.ch/";
|
const URL = "https://zeitungsarchiv.nzz.ch/";
|
||||||
const WAIT_TIMEOUT = 3000;
|
const WAIT_TIMEOUT = 10000;
|
||||||
const TIMEOUT_MSG = `Timeout after ${WAIT_TIMEOUT / 1000} seconds.`;
|
const TIMEOUT_MSG = `Timeout after ${WAIT_TIMEOUT / 1000} seconds.`;
|
||||||
const SEARCH_WAIT_TIMEOUT = 5000;
|
const SEARCH_WAIT_TIMEOUT = 15000;
|
||||||
const SEARCH_TIMEOUT_MSG = `Timeout after ${SEARCH_WAIT_TIMEOUT / 1000} seconds.`;
|
const SEARCH_TIMEOUT_MSG = `Timeout after ${SEARCH_WAIT_TIMEOUT / 1000} seconds.`;
|
||||||
const DOWNLOAD_TIMEOUT = 20000;
|
const DOWNLOAD_TIMEOUT = 20000;
|
||||||
const USER_AGENT =
|
const USER_AGENT =
|
||||||
@ -85,6 +85,8 @@ async function enterDate(driver, date) {
|
|||||||
WAIT_TIMEOUT,
|
WAIT_TIMEOUT,
|
||||||
TIMEOUT_MSG,
|
TIMEOUT_MSG,
|
||||||
);
|
);
|
||||||
|
await driver.wait(until.elementIsVisible(startDate), WAIT_TIMEOUT);
|
||||||
|
await driver.actions().scroll(0, 0, 0, 0, startDate).perform();
|
||||||
await startDate.clear();
|
await startDate.clear();
|
||||||
await startDate.sendKeys(dateString);
|
await startDate.sendKeys(dateString);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user