What it is
Puppeteer is a library for controlling a browser from JavaScript and TypeScript. It launches Chrome or Firefox, opens pages, clicks elements, types text, reads the DOM, takes screenshots, and automates browser actions.
The project grew around Chrome DevTools Protocol and was one of the main ways to automate headless Chrome. It now also works with WebDriver BiDi and Firefox, while the puppeteer package downloads a compatible Chrome by default.
What is inside and how people use it
The repository contains the library, API, tests, documentation, and browser packages. puppeteer-core exists for environments where the browser is already installed or managed separately.
Minimal automation
This example shows the basic flow: open a page, read its title, and close the browser.
import puppeteer from 'puppeteer'
const browser = await puppeteer.launch()
const page = await browser.newPage()
await page.goto('https://developer.chrome.com/')
console.log(await page.title())
await browser.close()
Common scenarios include end-to-end checks, PDF or screenshot generation, internal-page automation, extension testing, and admin workflows. Playwright is often chosen for user-facing test suites, but Puppeteer remains a strong Chrome automation tool.
Strengths and limitations
The strength is a clear API and closeness to browser capabilities. Puppeteer solves tasks that need a real Chromium instance rather than an HTTP client.
The limitation is browser automation fragility. Selectors change, sites may resist automation, and headless environments differ from real users. Reliable work needs resilient locators, waits, and controlled environments.