catch error for inputing solution

This commit is contained in:
2022-09-09 14:07:53 +02:00
parent 1c5325cb9b
commit ffd49a3a87
+14 -5
View File
@@ -196,11 +196,20 @@ class CommandorPage {
this.captchaSolver = new SolveCaptcha(page); this.captchaSolver = new SolveCaptcha(page);
await this.captchaSolver.start((solution) => { await this.captchaSolver.start((solution) => {
console.log("solution is: " + solution); console.log("solution is: " + solution);
if (solution !== ERROR_CAPTCHA_UNSOLVABLE){ if (solution !== ERROR_CAPTCHA_UNSOLVABLE) {
page.evaluate((solution) => { try {
document.getElementById("g-recaptcha-response").innerHTML = solution; page.evaluate((solution) => {
}, solution) document.getElementById("g-recaptcha-response").innerHTML = solution;
this.clickValid();} }, solution)
this.clickValid();
}
catch
(e)
{
console.log(e)
this.isTerminated = true;
}
}
else{ else{
this.isTerminated = true; this.isTerminated = true;
} }