LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

puppeteer

Browser automation and testing library

TLDR

Install Puppeteer
$ npm install puppeteer
copy
Run Puppeteer script
$ node [script.js]
copy
Install without bundled Chrome
$ npm install puppeteer-core
copy

SYNOPSIS

puppeteer JavaScript library for browser automation

DESCRIPTION

Puppeteer is a Node.js library for controlling Chrome/Chromium. It provides a high-level API for headless browser automation, testing, screenshot capture, and PDF generation.

EXAMPLES

$ // Generate PDF
await page.pdf({path: 'page.pdf', format: 'A4'});

// Click element
await page.click('#submit');

// Type text
await page.type('#search', 'query');

// Wait for selector
await page.waitForSelector('.result');

// Evaluate in page context
const title = await page.evaluate(() => document.title);

// Headful mode
const browser = await puppeteer.launch({headless: false});
copy

BASIC SCRIPT

$ const puppeteer = require('puppeteer');

(async () => {
  const browser = await puppeteer.launch();
  const page = await browser.newPage();
  await page.goto('https://example.com');
  await page.screenshot({path: 'example.png'});
  await browser.close();
})();
copy

COMMON OPTIONS

$ puppeteer.launch({
  headless: true,
  slowMo: 100,           // Slow down
  args: ['--no-sandbox'],
  executablePath: '/path/to/chrome'
});
copy

INSTALL

yay -S puppeteer
copy

CAVEATS

Downloads Chromium by default (~150MB). Use puppeteer-core with own browser. Memory-intensive.

HISTORY

Puppeteer was developed by the Google Chrome DevTools team, released in 2017 as the official Node.js library for Chrome automation.

SEE ALSO

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid