dsfdsf
This commit is contained in:
@@ -42,7 +42,7 @@ class SeleniumBrowser {
|
|||||||
logger.info('URL %s', uri)
|
logger.info('URL %s', uri)
|
||||||
if (uri.indexOf('://') > 3) {
|
if (uri.indexOf('://') > 3) {
|
||||||
return this.pool.acquire()
|
return this.pool.acquire()
|
||||||
// return this.getDriver()
|
// return this.getDriver()
|
||||||
.then(async driver => {
|
.then(async driver => {
|
||||||
let html = await driver.get(uri)
|
let html = await driver.get(uri)
|
||||||
.then(() => driver.findElement(By.css('body')))
|
.then(() => driver.findElement(By.css('body')))
|
||||||
@@ -66,9 +66,9 @@ class SeleniumBrowser {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getHtml(driver, html, params) {
|
getHtml(driver, html, params) {
|
||||||
if (params.waitElement) {
|
if (params.waitElements) {
|
||||||
return driver.get(params.uri)
|
return driver.get(params.uri)
|
||||||
.then(() => driver.wait(until.elementLocated(By.css(params.waitElement))))
|
.then(() => Promise.all(params.waitElements.map(s => driver.wait(until.elementLocated(By.css(s))))))
|
||||||
.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