catch error for inputing solution

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