This commit is contained in:
spiduler
2020-10-21 22:44:56 +09:00
parent df6b5d5df5
commit e8615cc26e

View File

@@ -85,17 +85,17 @@ class SeleniumBrowser {
res = await this.requestCaptchaResult(res, requestId)
if (maxRetry == 0) break
} while (res.request == 'CAPCHA_NOT_READY')
this.isRecaptchaReseponseEmpty = false
this.pool.release(driver)
this.isRecaptchaReseponseEmpty = false
return res
}).then(res => {
logger.debug(res, '2captcha solved')
driver.executeScript('captchaCallback("' + res.request + '")')
driver.wait(10000).then(d => {
driver.findElement(By.css('#g-recaptcha-response')).then(function (webElement) {
logger.error(res, 'Failed to overcome recaptcha')
}, function (err) {
logger.info('Success to overcome recaptcha')
driver.findElement(By.css('#g-recaptcha-response'))
.then(() => {
throw new Error('Still captcha page')
}).catch(err => {
logger.error({message: err.message}, 'Since 2captcha solved')
this.pool.release(driver)
})
})
}).catch(error => {