fix(core): update
This commit is contained in:
@ -61,12 +61,13 @@ export class SmartBrowser {
|
||||
* @param urlArg
|
||||
* @param funcArg
|
||||
*/
|
||||
public async evaluateOnPage(urlArg: string, funcArg: () => Promise<any>) {
|
||||
public async evaluateOnPage<T>(urlArg: string, funcArg: () => Promise<T>) {
|
||||
const page = await this.headlessBrowser.newPage();
|
||||
await page.goto(urlArg, {
|
||||
waitUntil: 'networkidle2'
|
||||
});
|
||||
const result = await page.evaluate(funcArg);
|
||||
await page.close();
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user