dsfsd
This commit is contained in:
@@ -93,9 +93,9 @@ class CaptchaComp {
|
||||
let retryLimit = 10
|
||||
let res = await this.request({ id: id })
|
||||
while (res.request == 'CAPCHA_NOT_READY') {
|
||||
logger.info('Retry get recap answer in %d senconds', this.api.retryTimeout / 1000)
|
||||
await this.sleep(this.api.retryTimeout)
|
||||
retryLimit = retryLimit - 1
|
||||
logger.info('Retry get recap answer in 5 senconds')
|
||||
retryLimit = retryLimit - 1
|
||||
res = await this.request({ id: id })
|
||||
if (retryLimit == 0) break
|
||||
}
|
||||
|
||||
@@ -32,7 +32,9 @@ class SeleniumBrowser {
|
||||
getHtml(driver, html, params) {
|
||||
if (params.waitElements) {
|
||||
return driver.get(params.uri)
|
||||
.then(() => Promise.all(params.waitElements.map(s => driver.wait(until.elementLocated(By.css(s)), 20000))))
|
||||
.then(() => Promise.all(params.waitElements.map(s => driver.wait(until.elementLocated(By.css(s)), 20000).catch(err => {
|
||||
logger.info({ message: err.message, selector: s }, 'Element located failed')
|
||||
}))))
|
||||
.then(() => driver.findElement(By.css('body')))
|
||||
.then(body => body.getAttribute('innerHTML'))
|
||||
.then(html => {
|
||||
|
||||
Reference in New Issue
Block a user