puppeteer /puppeteer
JavaScript API for Chrome and Firefox
★ 95,816⑂ 9,594👁 1,186⑃ 8,072● 7,444▤ 722◈ 0
95,816
stars
+0
9,594
forks
1,186
watchers
8,072
prs
7,444
issues
722
releases
0
discussions
README
Puppeteer
Puppeteer is a JavaScript library which provides a high-level API to control
Chrome or Firefox over the
DevTools Protocol or WebDriver BiDi.
Puppeteer runs in the headless (no visible UI) by default
Get started | API | FAQ | Contributing | Troubleshooting
Installation
bash npm2yarn
npm i puppeteer Downloads compatible Chrome during installation.
npm i puppeteer-core Alternatively, install as a library, without downloading Chrome.
:::note
Modern package managers (including npm (see the RFC), pnpm, Yarn, Bun, and Deno) block dependency install scripts by default. If the install script is blocked, Puppeteer will not download the browser during installation, leading to runtime errors.
You can manually download the required browsers after installation by running:
bash npm2yarn
npx puppeteer browsers install
Alternatively, you can configure your package manager to allow the install script to run (for example, with npm, by adding "puppeteer" to "allowScripts" in your package.json).
:::
MCP
Install chrome-devtools-mcp,
a Puppeteer-based MCP server for browser automation and debugging.
Puppeteer also supports the experimental WebMCP API.
Example
ts
import puppeteer from 'puppeteer';
// Or import puppeteer from 'puppeteer-core';
// Launch the browser and open a new blank page.
const browser = await puppeteer.launch();
const page = await browser.newPage();
// Navigate the page to a URL.
await page.goto('https://developer.chrome.com/');
// Set the screen size.
await page.setViewport({width: 1080, height: 1024});
// Open the search menu using the keyboard.
await page.keyboard.press('/');
// Type into search box using accessible input name.
await page.locator('::-p-aria(Search)').fill('automate beyond recorder');
// Wait and click on first result.
await page.locator('.devsite-result-item-link').click();
// Locate the full title with a unique string.
const textSelector = await page
.locator('::-p-text(Customize and automate)')
.waitHandle();
const fullTitle = await textSelector?.evaluate(el = el.textContent);
// Print the full title.
console.log('The title of this blog post is "%s".', fullTitle);
await browser.close();Top issues
#12379Chrome Canary/Firefox Nightly test results298 comments · 2024-05-02#1576fullPage screenshot duplicates page (doubles/tripples page length)47 comments · 2017-12-11#5341Error: Protocol error (Page.captureScreenshot): Unable to capture screenshot when taking screenshot of a large viewport39 comments · 2020-01-25#3667Intercept target creation29 comments · 2018-12-13#2167Scripts are not evalutated in header and footer HTML templates for PDFs.29 comments · 2018-03-08#1191Support response interception29 comments · 2017-10-27#540How do I get rid of popup for chromium certificates selection, can I set it programmatically ?29 comments · 2017-08-25#7234FileChooser.accept doesn't work on file dialogs not associated with an input element24 comments · 2021-05-12
Latest release
browsers: v3.2.6 browsers-v3.2.6 2026-10-223.2.6 (2026-10-22) 🛠️ Fixes browsers: resolve redirects against the current URL (15540) (e21d806)
相关报道 (6)
CSDNGitHub日榜背后的工程真相:从爬虫到技术决策的数据管道2026-11-08InfoQ.cnnpm 终于动手了:默认封杀 postinstall 脚本2026-08-22搜狐网AI自动化哭了!Lightpanda快Chrome11倍省9成内存,这才是真刚需2026-03-16QQ NewsGitHub上一款1.7万人收藏的AI助手Clawdbot空前爆火!一天涨星 9000Star2026-01-26view.inews.qq.com斩获10K Star!谷歌最新Chrome MCP接入Caude Code又香了~2025-10-13QQ NewsLeCun新作:分层世界模型,数据驱动的人型机器人控制2024-06-04
News & coverage (14)
Hacker NewsPrototype: Puppeteer for Firefox▲ 2 · 0 comments · 2020-04-19Hacker NewsPuppeteer switches to Chrome for Testing instead of Chromium▲ 1 · 1 comments · 2023-05-03Hacker NewsNew version of Puppeteer fully compatible with Firefox▲ 1 · 0 comments · 2020-01-28Hacker NewsShow HN: Download GitHub invoices using Puppeteer▲ 1 · 0 comments · 2018-01-05noteWhen I asked AI to 'install MCP' 30 times, Puppeteer was an old server all 6 times (verified with Docker)2026-11-03noteAI에게 'MCP를 넣어줘'라고 30번 부탁했더니, Puppeteer는 6번 모두 구형 서버였다 (Docker로 검증)2026-11-03Security BoulevardIs Puppeteer stealth dead? Not yet, but its best days are over2025-11-06HackerElevate Your Scraping Project With Puppeteer Extra2024-09-03HackerNoonYour GitHub Actions Cron Job Can Disappear Without Failing2026-11-04HackerNoon119 Blog Posts To Learn About Github Actions2026-10-17