How can I console.log something inside the page.evaluate, passing it to node and using it during the evaluation of the page?
I actually want to log the progress of the page.evaluate to the console and show some results to the user.
**Updated to work with puppeteer v1.4.x
If all you want is to "log the progress of the page.evaluate to the console", then just
const page = await browser.newPage();
page.on('console', consoleObj => console.log(consoleObj.text()));
And use console.log
in page.evaluate
as usual, no more dependencies are required.
Also see this nice tweak to remove multiple annoying warnings from log.