MCPcopy
hub / github.com/puppeteer/puppeteer

github.com/puppeteer/puppeteer @puppeteer-core-v25.3.0 sqlite

repository ↗ · DeepWiki ↗ · release puppeteer-core-v25.3.0 ↗
2,946 symbols 8,957 edges 482 files 386 documented · 13%
README

Puppeteer

build npm puppeteer package

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](https://github.com/npm/rfcs/pull/868)), 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

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();

Extension points exported contracts — how you extend this code

Connection (Interface)
(no doc) [12 implementers]
packages/puppeteer-core/src/bidi/core/Connection.ts
BrowserProvider (Interface)
(no doc) [4 implementers]
packages/browsers/src/provider.ts
FilePlaceholder (Interface)
(no doc) [1 implementers]
test/src/utils.ts
Version (Interface)
(no doc)
tools/merge-changelogs.ts
RecommendedExpectation (Interface)
(no doc)
tools/mocha-runner/src/utils.ts
Position (Interface)
(no doc)
tools/doctest/src/doctest.ts
IMarkdownDocumenterOptions (Interface)
(no doc)
tools/docgen/src/custom_markdown_documenter.ts
NodePackage (Interface)
(no doc)
packages/ng-schematics/src/schematics/utils/packages.ts

Core symbols most depended-on inside this repo

getTestState
called by 1142
test/src/mocha-utils.ts
evaluate
called by 952
packages/puppeteer-core/src/cdp/WebWorker.ts
goto
called by 800
packages/puppeteer-core/src/cdp/Frame.ts
on
called by 451
packages/puppeteer-core/src/common/EventEmitter.ts
emit
called by 265
packages/puppeteer-core/src/common/EventEmitter.ts
url
called by 259
packages/puppeteer-core/src/cdp/Frame.ts
setContent
called by 251
packages/puppeteer-core/src/cdp/Frame.ts
html
called by 239
test/src/utils.ts

Shape

Method 1,535
Function 806
Class 373
Interface 207
Enum 25

Languages

TypeScript100%

Modules by API surface

packages/puppeteer-core/src/cdp/Page.ts96 symbols
packages/puppeteer-core/src/bidi/Page.ts89 symbols
packages/puppeteer-core/src/api/ElementHandle.ts64 symbols
packages/puppeteer-core/src/api/locators/locators.ts63 symbols
packages/puppeteer-core/src/api/Page.ts62 symbols
packages/puppeteer-core/src/cdp/EmulationManager.ts54 symbols
packages/puppeteer-core/src/bidi/core/BrowsingContext.ts51 symbols
packages/puppeteer-core/src/cdp/Input.ts47 symbols
packages/puppeteer-core/src/cdp/NetworkManager.ts45 symbols
packages/puppeteer-core/src/bidi/Target.ts43 symbols
packages/puppeteer-core/src/cdp/Browser.ts42 symbols
packages/puppeteer-core/src/bidi/Input.ts40 symbols

Dependencies from manifests, versioned

@actions/core3.0.1 · 1×
@angular-devkit/architect0.1801.4 · 1×
@angular-devkit/core18.1.4 · 1×
@angular-devkit/schematics18.1.4 · 1×
@angular/cli22.0.4 · 1×
@babel/core8.0.1 · 1×
@babel/plugin-transform-class-properties8.0.1 · 1×
@babel/plugin-transform-class-static-block8.0.1 · 1×
@babel/plugin-transform-dynamic-import8.0.1 · 1×
@babel/plugin-transform-modules-commonjs8.0.1 · 1×
@babel/plugin-transform-private-methods8.0.1 · 1×
@babel/plugin-transform-private-property-in-object8.0.1 · 1×

For agents

$ claude mcp add puppeteer \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact