sdfdf
This commit is contained in:
@@ -34,20 +34,9 @@ class SeleniumBrowser {
|
|||||||
if (uri.indexOf('://') > 3) {
|
if (uri.indexOf('://') > 3) {
|
||||||
return this.getDriver().then(driver => {
|
return this.getDriver().then(driver => {
|
||||||
return driver.get(uri)
|
return driver.get(uri)
|
||||||
.then(() => {
|
|
||||||
if (waitElement) {
|
|
||||||
return driver.wait(until.elementIsVisible(driver.findElement(By.css(waitElement))), 5 * 1000)
|
|
||||||
}
|
|
||||||
return true
|
|
||||||
})
|
|
||||||
.then(() => driver.findElement(By.css('body')))
|
.then(() => driver.findElement(By.css('body')))
|
||||||
.then(body => body.getAttribute('innerHTML'))
|
.then(body => body.getAttribute('innerHTML'))
|
||||||
.then(html => this.getHtml(html))
|
.then(html => this.getHtml(html))
|
||||||
.catch(error => {
|
|
||||||
return driver.findElement(By.css('body'))
|
|
||||||
.then(body => body.getAttribute('innerHTML'))
|
|
||||||
.then(html => this.getHtml(html))
|
|
||||||
})
|
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
driver.quit()
|
driver.quit()
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user