Version: 1.1.0
Scraping and verification
Evaluating JavaScript#
Execute JavaScript function in the page:
If the result is a Promise or if the function is asynchronous evaluate will automatically wait until it's resolved:
Get object handle and use it in multiple evaluations:
API reference#
- page.$(selector)
- page.$$(selector)
- page.$eval(selector, pageFunction[, arg])
- page.$$eval(selector, pageFunction[, arg])
- page.evaluate(pageFunction[, arg])
- page.evaluateHandle(pageFunction[, arg])
Capturing screenshot#
API reference#
Page events#
You can listen for various events on the page object. Following are just some of the examples of the events you can assert and handle:
"console" - get all console messages from the page#
"dialog" - handle alert, confirm, prompt#
"popup" - handle popup windows#
API reference#
Handling exceptions#
Listen uncaught exceptions in the page: