Skip to content

Conversation

@aslushnikov
Copy link
Contributor

This patch adds a Page.$$eval method that runs document.querySelectorAll
and passes resulting array to the page function.

Fixes #625.

This patch adds a Page.$$eval method that runs document.querySelectorAll
and passes resulting array to the page function.

Fixes puppeteer#625.
* @param {!Array<*>} args
* @return {!Promise<(!Object|undefined)>}
*/
async $$eval(selector, pageFunction, ...args) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Can avoid reassigning to args
await this.evaluate(pageFunction, arrayHandle, ...args)

@aslushnikov aslushnikov merged commit 7a8aa73 into puppeteer:master Oct 11, 2017
ithinkihaveacat pushed a commit to ithinkihaveacat/puppeteer that referenced this pull request Oct 31, 2017
This patch adds a `Page.$$eval` method that runs `document.querySelectorAll`
and passes resulting array to the page function.

Fixes puppeteer#625.
@aslushnikov aslushnikov deleted the ddeval branch January 25, 2018 21:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants