dsfsd
This commit is contained in:
@@ -93,9 +93,9 @@ class CaptchaComp {
|
|||||||
let retryLimit = 10
|
let retryLimit = 10
|
||||||
let res = await this.request({ id: id })
|
let res = await this.request({ id: id })
|
||||||
while (res.request == 'CAPCHA_NOT_READY') {
|
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)
|
await this.sleep(this.api.retryTimeout)
|
||||||
retryLimit = retryLimit - 1
|
retryLimit = retryLimit - 1
|
||||||
logger.info('Retry get recap answer in 5 senconds')
|
|
||||||
res = await this.request({ id: id })
|
res = await this.request({ id: id })
|
||||||
if (retryLimit == 0) break
|
if (retryLimit == 0) break
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,7 +32,9 @@ class SeleniumBrowser {
|
|||||||
getHtml(driver, html, params) {
|
getHtml(driver, html, params) {
|
||||||
if (params.waitElements) {
|
if (params.waitElements) {
|
||||||
return driver.get(params.uri)
|
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(() => driver.findElement(By.css('body')))
|
||||||
.then(body => body.getAttribute('innerHTML'))
|
.then(body => body.getAttribute('innerHTML'))
|
||||||
.then(html => {
|
.then(html => {
|
||||||
|
|||||||
Reference in New Issue
Block a user