puppeteer
A high-level API to control headless Chrome over the DevTools Protocol
Last updated 2 months ago by google-wombot .
Apache-2.0 · Repository · Bugs · Original npm · Tarball · package.json
$ npm install puppeteer 
SYNC missed versions from official npm registry.

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

npm i puppeteer # Downloads compatible Chrome during installation.
npm i puppeteer-core # Alternatively, install as a library, without downloading Chrome.

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 screen size.
await page.setViewport({width: 1080, height: 1024});

// Type into search box.
await page.locator('.devsite-search-field').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('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();

Current Tags

  • 1.0.0                                ...           chrome-65 (7 years ago)
  • 1.1.1                                ...           chrome-66 (7 years ago)
  • 1.3.0                                ...           chrome-67 (7 years ago)
  • 1.4.0                                ...           chrome-68 (7 years ago)
  • 1.6.2                                ...           chrome-69 (6 years ago)
  • 1.7.0                                ...           chrome-70 (6 years ago)
  • 1.9.0                                ...           chrome-71 (6 years ago)
  • 1.11.0                                ...           chrome-72 (6 years ago)
  • 1.12.2                                ...           chrome-73 (6 years ago)
  • 1.13.0                                ...           chrome-74 (6 years ago)
  • 1.15.0                                ...           chrome-75 (6 years ago)
  • 1.17.0                                ...           chrome-76 (6 years ago)
  • 1.19.0                                ...           chrome-77 (5 years ago)
  • 1.20.0                                ...           chrome-78 (5 years ago)
  • 2.0.0                                ...           chrome-79 (5 years ago)
  • 2.1.0                                ...           chrome-80 (5 years ago)
  • 3.0.0                                ...           chrome-81 (5 years ago)
  • 3.1.0                                ...           chrome-83 (5 years ago)
  • 5.1.0                                ...           chrome-84 (4 years ago)
  • 5.2.1                                ...           chrome-85 (4 years ago)
  • 5.3.1                                ...           chrome-86 (4 years ago)
  • 23.10.3                                ...           latest (14 days ago)

913 Versions

Downloads
Total 178
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 1
Last Month 175
Dependencies (6)
Dev Dependencies (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE