Puppeteer Snippets

Puppeteer (opens new window) is a Node.js library that provides a high-level API for controlling Chrome and Chromium browses, enabling web automation, testing, and scraping. The Write Javascript step offers the ability to access various Puppeteer objects and interact with the web browser. We expose the Page class within the step, you can learn more about the Page interactions (opens new window) in their documentation. Most functions are already available within the Interact steps that we provide, however, if you wish to customise these further, you can do so.

Note: automations containing Puppeteer code needs to be run using the "Run in app" option and run locally.

The snippets below can help you get started. We've broken them up into categories:

Looking to trigger your code using event handlers? The EventEmitter (opens new window) class within the "Write Javascript" step allows you to do so. You can see samples here (opens new window).

Can't find what you're looking for or want to share something you've worked on? Let us know in our community (opens new window)