check recaptcha before calling 2captcha

This commit is contained in:
2023-03-06 20:13:00 +01:00
parent c687b92c1c
commit b006426867
+3 -2
View File
@@ -7,7 +7,7 @@ const {
shell
} = require('electron')
const GeoCaptchaSolver = require("./GeoCaptchaSolver");
// const RDV_URL = "http://192.168.0.13:8000/test_appointment.html"
// const RDV_URL = "http://192.168.0.13:8000/test_appointment.html";
const RDV_URL = "https://rendezvousparis.hermes.com/client/register";
const BLANK_URL = "about:blank"
const ERROR_CAPTCHA_UNSOLVABLE = "ERROR_CAPTCHA_UNSOLVABLE";
@@ -313,7 +313,8 @@ class CommandorPage {
return
}
//check whether there is captcha
let hasCaptcha = await page.isVisible("g-recaptcha-response")
let pageContent = await page.content()
let hasCaptcha = pageContent.includes("g-recaptcha-response")
if (hasCaptcha) {
this.captchaSolver = new SolveCaptcha(page);
await this.captchaSolver.start((solution) => {