Skip to main content
Version: 25.15.0

Examples & Use cases

Official examples​

The Puppeteer repository includes a small number of examples maintained by the Puppeteer team.

Follow the instructions in the README to run the examples. They cover use cases such as generating PDFs from websites, taking screenshots, and intercepting requests.

Example suite​

Find a collection of use-case-driven examples in Puppeteer's dedicated example repository.

This suite is a growing collection of examples covering various use cases, such as forwarding events from your Puppeteer process to the browser, interacting with elements, and running CDP commands.

Other projects, articles, and demos​

See the following list for use cases and examples in areas such as rendering, web scraping, and testing.

Rendering and web scraping​

  • Puppetron: A demo site that shows how to use Puppeteer and Headless Chrome to render pages. Inspired by GoogleChrome/rendertron, which is now archived.
  • Thal: A guide to getting started with Puppeteer and Chrome Headless for web scraping.
  • pupperender: Express middleware that checks the User-Agent header of incoming requests and, if it matches a configurable set of bots, renders the page using Puppeteer. Useful for progressive web app (PWA) rendering.
  • headless-chrome-crawler: A crawler that provides APIs to control Headless Chrome and crawl dynamic websites.
  • Puppeteer examples from Checkly: End-to-end Puppeteer examples for real-world use cases, such as extracting useful information from web pages and handling common login scenarios.
  • browserless: A headless Chrome service that lets you execute Puppeteer scripts remotely.
  • Puppeteer on AWS Lambda: A guide to running Puppeteer on AWS Lambda with the Serverless Framework.
  • Crawlee: A web scraping and browser automation library for Node.js and TypeScript. It supports Puppeteer, Playwright, Cheerio, JSDOM, and raw HTTP, with proxy rotation.

Testing​

  • angular-puppeteer-demo: A demo repository showing how to use Puppeteer with Karma.
  • mocha-headless-chrome: A tool that runs client-side Mocha tests from the command line using Headless Chrome.
  • puppeteer-to-istanbul-example: A demo repository showing how to export Puppeteer coverage data in Istanbul format.
  • jest-puppeteer: An almost zero-configuration tool for running Jest tests with Puppeteer. It also includes an assertion library for Puppeteer.
  • puppeteer-har: A tool for generating HAR files with Puppeteer.
  • puppetry: A desktop app for building Puppeteer- and Jest-driven tests without writing code.
  • puppeteer-loadtest: A command-line tool for load-testing Puppeteer scripts.
  • cucumber-puppeteer-example: An example repository demonstrating how to use Puppeteer with Cucumber for integration testing.