add try catch for click()

This commit is contained in:
2023-01-11 12:23:38 +01:00
parent 229056e2cc
commit aa8cb2da99
+5 -1
View File
@@ -64,7 +64,11 @@ class GeoCaptchaSolver {
console.log("play audio")
let iframeHandler = await this.page.frameLocator("body > iframe");
let playAudioBtn = await iframeHandler.locator(PLAY_AUDIO_BTN_ID);
playAudioBtn.click();
try {
playAudioBtn.click();
} catch (e) {
console.log(e)
}
await delay(4000 + getRandomWaitTime());
let captcha_container = await iframeHandler.locator(CAPTCHA_CONTAINER)
let html = await captcha_container.innerHTML()