puppeteer/examples
Thomas Chaplin 9275653130
docs(examples): update selector for search example (#6471)
This commit updates the selector used in some examples as it no longer matched the target page’s DOM.

Fixes #6470, fixes #5071.
2020-10-05 06:48:34 +02:00
..
block-images.js chore: add Prettier (#5825) 2020-05-07 12:54:55 +02:00
cross-browser.js chore: add Prettier (#5825) 2020-05-07 12:54:55 +02:00
custom-event.js docs: replace @return with @returns (#6006) 2020-06-12 12:38:24 +02:00
detect-sniff.js chore: add Prettier (#5825) 2020-05-07 12:54:55 +02:00
oopif.js feat(OOPIF): debug message in case of iFrame moved to another process (#6432) 2020-09-21 13:23:36 +02:00
pdf.js chore: add Prettier (#5825) 2020-05-07 12:54:55 +02:00
proxy.js chore: add Prettier (#5825) 2020-05-07 12:54:55 +02:00
README.md docs(examples): add cucumber-puppeteer-example for integration testing (#5875) 2020-05-18 06:54:53 +02:00
screenshot-fullpage.js chore: remove top level errors and DeviceDescriptors (#6043) 2020-06-19 15:15:13 +02:00
screenshot.js chore: add Prettier (#5825) 2020-05-07 12:54:55 +02:00
search.js docs(examples): update selector for search example (#6471) 2020-10-05 06:48:34 +02: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.
  • cucumber-puppeteer-example - Example repository demonstrating how to use Puppeeteer and Cucumber for integration testing.

Services

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