Puppeteer is a JavaScript library that controls a web browser from code. It gives a high-level API to control Chrome or Firefox over the Chrome DevTools Protocol or WebDriver BiDi, two protocols through which a program sends commands to a browser. The project's site is published by Google.
A Node.js script launches the browser, opens pages, navigates to addresses, types, clicks and reads page content. By default the browser runs headless, without a visible window, but it can also run with one. Typical uses are automated form submission and UI tests, screenshots and PDFs of pages, performance traces, tests of Chrome extensions, and crawling a single-page application to produce pre-rendered HTML (static HTML made in advance from pages that the browser normally builds with JavaScript). Installing the puppeteer package with npm, Yarn, pnpm or Bun also downloads a compatible Chrome; puppeteer-core installs the library alone.
Puppeteer is free and open source under the Apache-2.0 license. A Puppeteer-based MCP server, chrome-devtools-mcp, lets AI agents automate and debug the browser.