puppeteer
TypeScript icon, indicating that this package has built-in type declarations

24.7.2 • Public • Published

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

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 using accessible input name.
await page.locator('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('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();

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
24.7.20latest

Version History

VersionDownloads (Last 7 Days)Published
24.7.20
24.7.150,839
24.7.067,339
24.6.1310,841
24.6.048,492
24.5.018,983
24.4.0131,924
24.3.114,335
24.3.029,412
24.2.124,577
24.2.033,703
24.1.154,779
24.1.031,572
24.0.06,317
23.11.1218,121
23.11.03,907
23.10.421,428
23.10.315,246
23.10.21,986
23.10.187,216
23.10.02,486
23.9.034,795
23.8.014,570
23.7.112,752
23.7.07,227
23.6.122,819
23.6.073,906
23.5.315,849
23.5.21,207
23.5.160,538
23.5.016,516
23.4.117,558
23.4.06,864
23.3.18,551
23.3.024,046
23.2.221,482
23.2.114,411
23.2.04,484
23.1.131,808
23.1.010,431
23.0.225,384
23.0.13,777
23.0.0310
22.15.0383,609
22.14.021,993
22.13.154,068
22.13.012,065
22.12.136,329
22.12.026,397
22.11.211,700
22.11.11,720
22.11.010,465
22.10.12,282
22.10.017,215
22.9.06,253
22.8.25,139

Package Sidebar

Install

npm i puppeteer

Weekly Downloads

4,330,829

Version

24.7.2

License

Apache-2.0

Unpacked Size

361 kB

Total Files

43

Last publish

Collaborators

  • mathias
  • google-wombot