diff --git a/src/workers/GeoCaptchaSolver.js b/src/workers/GeoCaptchaSolver.js index c7c4eae..60e8305 100644 --- a/src/workers/GeoCaptchaSolver.js +++ b/src/workers/GeoCaptchaSolver.js @@ -83,16 +83,23 @@ class GeoCaptchaSolver { // fieldInputs[i].value = number_list[i]; await delay(500 + getRandomWaitTime()); } - let content = await captcha_container.innerHTML() - console.log("inner container is " + content) - try { - if (number_list.length === 0) { - onResult(false) - } else { - onResult(true) + if (!this.page.isClosed()) { + try { + + let content = await captcha_container.innerHTML() + console.log("inner container is " + content) + try { + if (number_list.length === 0) { + onResult(false) + } else { + onResult(true) + } + } catch (e) { + console.log(e) + } + } catch (e) { + console.log(e) } - } catch (e) { - console.log(e) } } )