foreach method
foreach
Implementation
Future<Online> foreach(
AbstractSelector selector, Function(ElementHandle, Ctx) action) async {
await (await page).waitForSelector(selector.selector);
var elements = await (await page).evaluate('''(selector) => {
return Array.from(document.querySelectorAll(selector));
}''', args: [selector.selector]);
for (var element in elements) {
await action(element, ctx);
}
return this;
}