correction when there is no recaptcha

This commit is contained in:
2023-08-10 10:54:03 +02:00
parent 8fcc749ca8
commit 6b9d05dfca
+11 -3
View File
@@ -525,8 +525,15 @@ class CommandorPage {
await this.fillEmail(page) await this.fillEmail(page)
await this.inputPassportId(page) await this.inputPassportId(page)
await this.checkCGU(page) await this.checkCGU(page)
await this.resolveCaptcha(page) let pageContent = await page.content()
await delay(10 * 1000) let hasCaptcha = pageContent.includes("g-recaptcha-response")
if (hasCaptcha) {
await this.resolveCaptcha(page)
await delay(10 * 1000)
} else {
await delay(2 * 1000)
await this.clickValid();
}
this.isFillingFields = false this.isFillingFields = false
} }
} }
@@ -583,6 +590,7 @@ class CommandorPage {
} }
} }
} catch (e) { } catch (e) {
logWithDevice("exception received", this.device)
log(e) log(e)
} }
} }
@@ -815,7 +823,7 @@ class CommandorPage {
} }
async checkResultWithOcr() { async checkResultWithOcr() {
console.log("checkResultWithOcr() called.") logWithDevice("checkResultWithOcr() called.", this.device)
await delay(4000); await delay(4000);
let checkResult = await this.ocrChecker.get_result(); let checkResult = await this.ocrChecker.get_result();
console.log(checkResult); console.log(checkResult);