Puppeteer

Package

JavaScript library that drives headless Chrome or Firefox from Node.js

Price
Free, open source
Access
None, runs locally

About

Google's Apache-2.0 library that controls Chrome or Firefox over the DevTools Protocol or WebDriver BiDi, headless by default. The puppeteer package downloads a matching Chrome for Testing on install; puppeteer-core skips the download. Needs Node 22.12 or newer.

What you can do with it

  • Save a web page or HTML template as a PDF with page.pdf()
  • Capture screenshots of a whole page or a single element
  • Automate form submission, clicks and keyboard input for UI tests

Get started

  1. Install Node.js 22.12 or newer
  2. Run npm i puppeteer, which downloads a compatible Chrome
  3. If install scripts are blocked, run npx puppeteer browsers install

Example

import puppeteer from 'puppeteer';

const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.goto('https://news.ycombinator.com', {
  waitUntil: 'networkidle2',
});
// Saves the PDF to hn.pdf.
await page.pdf({
  path: 'hn.pdf',
});

await browser.close();

Details

Hosting
Runs locally
Available in
Worldwide
Official SDKs
JavaScript/TypeScript
MCP server
None

Tasks

Alternatives

Other tools for the same tasks.

Last checked on .