Important: This documentation is about an older version. It's relevant only to the release noted, many of the features and functions have been updated or replaced. Please view the current version.
on(event, handler)
Registers a handler to be called whenever the specified event occurs.
Caution
When using the
page.on
method, the page has to be explicitly closed for the iteration to be able to finish.