try to fix sliding probleme

This commit is contained in:
2024-09-24 16:01:41 +02:00
parent 1c35cd1831
commit 4ee264c650
2 changed files with 21 additions and 22 deletions
+20 -21
View File
@@ -734,7 +734,7 @@ class CommandorPage {
await delay(5000);
}
await this.slidingCaptchaSolver.solve(this.page, async (isSuccessful) => {
logWithDevice("check isAlwaysBlocked",this.device)
logWithDevice("check isAlwaysBlocked", this.device)
this.isFillingFields = false
onResult(isSuccessful)
})
@@ -869,26 +869,6 @@ class CommandorPage {
logWithDevice("will recheck OCR", this.device)
checkResult = await this.ocrChecker.get_result();
}
while (checkResult === OCRResult.SLIDING_CAPTCHA) {
logWithDevice("will call this.slidingCaptcha()", this.device)
await this.slidingCaptcha(async (isSuccessful) => {
logWithDevice("SLIDING_CAPTCHA result is " + isSuccessful, this.device)
console.log(checkResult);
if (isSuccessful) {
await delay(5 * 1000)
checkResult = await this.ocrChecker.get_result();
// await this.checkResultWithOcr()
} else {
await this.checkResultWithOcr()
// if (checkResult === OCRResult.SLIDING_CAPTCHA) {
// checkResult = OCRResult.TERMINAED
// this.isTerminated = true
// }
}
})
await delay(10 * 1000)
}
switch (checkResult) {
case OCRResult.SLIDING_CAPTCHA_LOADING:
this.isTerminated = true;
@@ -902,6 +882,25 @@ class CommandorPage {
case OCRResult.SLIDING_CAPTCHA_REFRESH:
await this.connect_to_browser(checkResult)
break;
case OCRResult.SLIDING_CAPTCHA:
logWithDevice("will call this.slidingCaptcha()", this.device)
await this.slidingCaptcha(async (isSuccessful) => {
logWithDevice("SLIDING_CAPTCHA result is " + isSuccessful, this.device)
console.log(checkResult);
if (isSuccessful) {
await delay(5 * 1000)
// checkResult = await this.ocrChecker.get_result();
await this.checkResultWithOcr()
} else {
await this.checkResultWithOcr()
// if (checkResult === OCRResult.SLIDING_CAPTCHA) {
// checkResult = OCRResult.TERMINAED
// this.isTerminated = true
// }
}
})
// await delay(5 * 1000)
break;
case OCRResult.FILL_FIELD:
logWithDevice("FILL_FIELD", this.device)
if (this.browser === undefined || !this.browser.isConnected()) {