$$eval<T> method
This method runs Array.from(document.querySelectorAll(selector))
within
the page and passes it as the first argument to pageFunction
.
If pageFunction
returns a Promise
, then page.$$eval
would wait for
the promise to resolve and return its value.
Examples:
var divsCounts = await page.$$eval('div', 'divs => divs.length');
Parameters:
A selector
to query page for
pageFunction
Function to be evaluated in browser context
args
Arguments to pass to pageFunction
Returns a Future which resolves to the return value of pageFunction
Implementation
Future<T?> $$eval<T>(String selector, @Language('js') String pageFunction,
{List<dynamic>? args}) {
return mainFrame.$$eval<T>(selector, pageFunction, args: args);
}