reduce the random wait time

This commit is contained in:
2022-09-17 15:39:53 +02:00
parent f822cd455c
commit 02a62c3b75
+5 -1
View File
@@ -41,7 +41,7 @@ function delay(delayInms) {
} }
function getRandom() { function getRandom() {
return Math.floor(Math.random() * 5); return Math.floor(Math.random() * 3);
} }
function getRandomWaitTime() { function getRandomWaitTime() {
@@ -235,9 +235,13 @@ class CommandorPage {
}) })
await delay(getRandomWaitTime()) await delay(getRandomWaitTime())
if (!this.page.isClosed()) { if (!this.page.isClosed()) {
try {
this.page.evaluate(() => { this.page.evaluate(() => {
document.getElementsByClassName("btn")[0].click(); document.getElementsByClassName("btn")[0].click();
}) })
} catch (e) {
console.log(e)
}
} }
} }
} catch (e) { } catch (e) {