Skip to content

Commit

Permalink
docs(api): add example to page.$$eval (#5200)
Browse files Browse the repository at this point in the history
This makes it more clear that the callback receives an actual array of nodes instead of just a NodeList.

Co-authored-by: Mathias Bynens <mathias@qiwi.be>
  • Loading branch information
ffeu and mathiasbynens committed Jan 27, 2020
1 parent b45f8e4 commit c283fea
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion docs/api.md
Expand Up @@ -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])
Expand Down

0 comments on commit c283fea

Please sign in to comment.