From 6b9d05dfcab1c114d67b4f988f00ee1a8feb61e5 Mon Sep 17 00:00:00 2001 From: Lei PAN Date: Thu, 10 Aug 2023 10:54:03 +0200 Subject: [PATCH] correction when there is no recaptcha --- src/workers/CommandorPage.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/workers/CommandorPage.js b/src/workers/CommandorPage.js index a42c5a1..f6f54cf 100644 --- a/src/workers/CommandorPage.js +++ b/src/workers/CommandorPage.js @@ -525,8 +525,15 @@ class CommandorPage { await this.fillEmail(page) await this.inputPassportId(page) await this.checkCGU(page) - await this.resolveCaptcha(page) - await delay(10 * 1000) + let pageContent = await page.content() + 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 } } @@ -583,6 +590,7 @@ class CommandorPage { } } } catch (e) { + logWithDevice("exception received", this.device) log(e) } } @@ -815,7 +823,7 @@ class CommandorPage { } async checkResultWithOcr() { - console.log("checkResultWithOcr() called.") + logWithDevice("checkResultWithOcr() called.", this.device) await delay(4000); let checkResult = await this.ocrChecker.get_result(); console.log(checkResult);