fsdf
This commit is contained in:
@@ -92,6 +92,7 @@ class SeleniumBrowser {
|
|||||||
let uri = params.uri
|
let uri = params.uri
|
||||||
logger.info('URL %s', uri)
|
logger.info('URL %s', uri)
|
||||||
if (uri.indexOf('://') > 3) {
|
if (uri.indexOf('://') > 3) {
|
||||||
|
if (this.pool) {
|
||||||
return this.pool.acquire()
|
return this.pool.acquire()
|
||||||
.then(async driver => {
|
.then(async driver => {
|
||||||
let html = await driver.get(uri)
|
let html = await driver.get(uri)
|
||||||
@@ -102,6 +103,9 @@ class SeleniumBrowser {
|
|||||||
this.pool.destroy(driver)
|
this.pool.destroy(driver)
|
||||||
return html
|
return html
|
||||||
})
|
})
|
||||||
|
}else {
|
||||||
|
throw new Error('Pool is not ready')
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
throw new Error('Invalid URI - ' + uri)
|
throw new Error('Invalid URI - ' + uri)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user