1 | # Running the examples
|
2 |
|
3 | 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:
|
4 |
|
5 | ```sh
|
6 | NODE_PATH=../ node examples/search.js
|
7 | ```
|
8 |
|
9 | ## Larger examples
|
10 |
|
11 | More complex and use case driven examples can be found at https://github.com/GoogleChromeLabs/puppeteer-examples.
|
12 |
|
13 | # Tips & Tricks
|
14 |
|
15 | ## Load a Chrome extension
|
16 |
|
17 | By default, Puppeteer disables extensions when launching Chrome. You can load a specific
|
18 | extension using:
|
19 |
|
20 | ```js
|
21 | const browser = await puppeteer.launch({
|
22 | headless: false,
|
23 | args: [
|
24 | '--disable-extensions-except=/path/to/extension/',
|
25 | '--load-extension=/path/to/extension/',
|
26 | ]
|
27 | });
|
28 | ```
|
29 |
|
30 | # Other resources
|
31 |
|
32 | > Other useful tools, articles, and projects that use Puppeteer.
|
33 |
|
34 | ## Rendering and web scraping
|
35 |
|
36 | - [Puppetron](https://github.com/cheeaun/puppetron) - Demo site that shows how to use Puppeteer and Headless Chrome to render pages. Inspired by [GoogleChrome/rendertron](https://github.com/GoogleChrome/rendertron).
|
37 | - [Thal](https://medium.com/@e_mad_ehsan/getting-started-with-puppeteer-and-chrome-headless-for-web-scrapping-6bf5979dee3e "An article on medium") - Getting started with Puppeteer and Chrome Headless for Web Scraping.
|
38 | - [pupperender](https://github.com/LasaleFamine/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.
|
39 | - [headless-chrome-crawler](https://github.com/yujiosaka/headless-chrome-crawler) - Crawler that provides simple APIs to manipulate Headless Chrome and allows you to crawl dynamic websites.
|
40 | - [puppeteer-examples](https://github.com/checkly/puppeteer-examples) - Puppeteer Headless Chrome examples for real life use cases such as getting useful info from the web pages or common login scenarios.
|
41 | - [browserless](https://github.com/joelgriffith/browserless) - Headless Chrome as a service letting you execute Puppeteer scripts remotely. Provides a docker image with configuration for concurrency, launch arguments and more.
|
42 | - [Puppeteer Sandbox](https://puppeteersandbox.com) - Puppeteer sandbox environment as a service. Runs Puppeteer scripts and allows saving and embedding them in external sites and markdown files.
|
43 |
|
44 | ## Testing
|
45 |
|
46 | - [angular-puppeteer-demo](https://github.com/Quramy/angular-puppeteer-demo) - Demo repository explaining how to use Puppeteer in Karma.
|
47 | - [mocha-headless-chrome](https://github.com/direct-adv-interfaces/mocha-headless-chrome) - Tool which runs client-side **mocha** tests in the command line through headless Chrome.
|
48 | - [puppeteer-to-istanbul-example](https://github.com/bcoe/puppeteer-to-istanbul-example) - Demo repository demonstrating how to output Puppeteer coverage in Istanbul format.
|
49 |
|
50 | ## Services
|
51 | - [Checkly](https://checklyhq.com) - Monitoring SaaS that uses Puppeteer to check availability and correctness of web pages and apps.
|