This commit is contained in:
spiduler
2020-10-23 00:59:22 +09:00
parent 0aa1495e30
commit c513c125b5

View File

@@ -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 => {