puppeteer/examples
Maja Frydrychowicz d817ae5a4b
fix: update preferred revision after Launcher is created (#5640)
Fixes an edge case where Puppeteer looked for a Chromium revision when launching Firefox.

Allow appropriate Launcher to be instantiated when calling `Puppeteer.connect`.

Add an example of running Firefox.
2020-04-14 18:42:48 +02:00
..
block-images.js chore(examples): indent all examples (#1783) 2018-01-11 13:42:01 -08:00
cross-browser.js fix: update preferred revision after Launcher is created (#5640) 2020-04-14 18:42:48 +02:00
custom-event.js chore(examples): Change networkidle2 to networkidle0 (#2618) 2018-05-30 14:17:41 -07:00
detect-sniff.js chore(examples): indent all examples (#1783) 2018-01-11 13:42:01 -08:00
pdf.js chore(examples): indent all examples (#1783) 2018-01-11 13:42:01 -08:00
proxy.js chore(examples): exclude localhost from proxy bypass list (#3742) 2019-01-09 17:25:26 -08:00
README.md docs(examples): adding puppetry tool (#3598) 2018-12-05 13:41:24 -08:00
screenshot-fullpage.js chore(examples): indent all examples (#1783) 2018-01-11 13:42:01 -08:00
screenshot.js chore(examples): indent all examples (#1783) 2018-01-11 13:42:01 -08:00
search.js chore(examples): indent all examples (#1783) 2018-01-11 13:42:01 -08:00

Running the examples

Assuming you have a checkout of the Puppeteer repo and have run npm i (or yarn) to install the dependencies, the examples can be run from the root folder like so:

NODE_PATH=../ node examples/search.js

Larger examples

More complex and use case driven examples can be found at github.com/GoogleChromeLabs/puppeteer-examples.

Other resources

Other useful tools, articles, and projects that use Puppeteer.

Rendering and web scraping

  • Puppetron - Demo site that shows how to use Puppeteer and Headless Chrome to render pages. Inspired by GoogleChrome/rendertron.
  • Thal - Getting started with Puppeteer and Chrome Headless for Web Scraping.
  • pupperender - Express middleware that checks the User-Agent header of incoming requests, and if it matches one of a configurable set of bots, render the page using Puppeteer. Useful for PWA rendering.
  • headless-chrome-crawler - Crawler that provides simple APIs to manipulate Headless Chrome and allows you to crawl dynamic websites.
  • puppeteer-examples - Puppeteer Headless Chrome examples for real life use cases such as getting useful info from the web pages or common login scenarios.
  • browserless - Headless Chrome as a service letting you execute Puppeteer scripts remotely. Provides a docker image with configuration for concurrency, launch arguments and more.
  • Puppeteer Sandbox - Puppeteer sandbox environment as a service. Runs Puppeteer scripts and allows saving and embedding them in external sites and markdown files.

Testing

  • angular-puppeteer-demo - Demo repository explaining how to use Puppeteer in Karma.
  • mocha-headless-chrome - Tool which runs client-side mocha tests in the command line through headless Chrome.
  • puppeteer-to-istanbul-example - Demo repository demonstrating how to output Puppeteer coverage in Istanbul format.
  • jest-puppeteer - (almost) Zero configuration tool for setting up and running Jest and Puppeteer easily. Also includes an assertion library for Puppeteer.
  • puppeteer-har - Generate HAR file with puppeteer.
  • puppetry - A desktop app to build Puppeteer/Jest driven tests without coding.

Services

  • Checkly - Monitoring SaaS that uses Puppeteer to check availability and correctness of web pages and apps.