From c283fea6c5373d18e27366faa4f6948701028658 Mon Sep 17 00:00:00 2001 From: Feu Date: Mon, 27 Jan 2020 12:19:33 -0300 Subject: [PATCH] docs(api): add example to page.$$eval (#5200) This makes it more clear that the callback receives an actual array of nodes instead of just a NodeList. Co-authored-by: Mathias Bynens --- docs/api.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/api.md b/docs/api.md index 76a28c36ce782..34365a56e57ff 100644 --- a/docs/api.md +++ b/docs/api.md @@ -1111,7 +1111,11 @@ If `pageFunction` returns a [Promise], then `page.$$eval` would wait for the pro Examples: ```js -const divsCounts = await page.$$eval('div', divs => divs.length); +const divCount = await page.$$eval('div', divs => divs.length); +``` + +```js +const options = await page.$$eval('div > span.options', options => options.map(option => option.textContent)); ``` #### page.$eval(selector, pageFunction[, ...args])