From 2754be7761f94641c599fa63e160d571228d0145 Mon Sep 17 00:00:00 2001 From: PAN Lei Date: Fri, 9 Sep 2022 13:58:06 +0200 Subject: [PATCH] format --- src/workers/CommandorPage.js | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/workers/CommandorPage.js b/src/workers/CommandorPage.js index 96a1a1d..b4aacef 100644 --- a/src/workers/CommandorPage.js +++ b/src/workers/CommandorPage.js @@ -75,12 +75,10 @@ class CommandorPage { }) try { await this.page.goto(RDV_URL, {timeout: 90 * 1000}); - }catch (e) { + } catch (e) { console.log(e) this.isTerminated = true } - //wait 10 mins - // Close the device. let cancel const intervalTask = setInterval(() => { @@ -196,12 +194,12 @@ class CommandorPage { this.captchaSolver = new SolveCaptcha(page); await this.captchaSolver.start((solution) => { console.log("solution is: " + solution); - if (solution !== ERROR_CAPTCHA_UNSOLVABLE){ - page.evaluate((solution) => { - document.getElementById("g-recaptcha-response").innerHTML = solution; - }, solution) - this.clickValid();} - else{ + if (solution !== ERROR_CAPTCHA_UNSOLVABLE) { + page.evaluate((solution) => { + document.getElementById("g-recaptcha-response").innerHTML = solution; + }, solution) + this.clickValid(); + } else { this.isTerminated = true; } }) @@ -231,7 +229,7 @@ class CommandorPage { } } - async checkAudioBtn() { + async checkAudioBtn() { // let iframe = await this.page.locator("iframe").contentFrame; // let audioBtn = iframe.locator("#captcha__audio__button"); // if (audioBtn) {