Puppeteer is a JavaScript library that automates Chrome and Firefox via Chrome DevTools Protocol and WebDriver BiDi. Use it for UI testing, PDFs, screenshots, and scripted browsing.
Overview
Puppeteer offers a high-level Node.js API to control headless or full browser instances. It supports automation tasks ranging from DOM interaction and navigation to capturing visual output and exercising complex web interfaces.
Core capabilities include querying and manipulating page elements, typing and clicking, intercepting and modifying network traffic, and taking full-page or element screenshots. Documentation covers headless, headful, and shell run modes so you can choose how the browser runs for a given task.
The accompanying examples repository illustrates practical patterns such as measuring code coverage, verifying service worker caching, crawling site URLs, generating PDFs from DOM nodes, and comparing page load behavior side by side.
Puppeteer is published under Apache 2.0 and is positioned by Google Chrome for Developers as the entry point for programmatic browser control in Node.js projects.
Key features
- Chrome and Firefox automation
- DevTools Protocol and WebDriver BiDi
- DOM query and interaction APIs
- Network request interception
- Screenshots and PDF export
- Headless and headful run modes
- Performance and UI testing flows
Use cases
- End-to-end UI automation tests
- Server-side PDF or screenshot generation
- Crawling and URL discovery scripts
- Search rendering sanity checks
- Side-by-side page load comparisons