UNPKG

2.1 kBMarkdownView Raw
1# Running the examples
2
3Assuming you have a checkout of the Puppeteer repo and have run yarn (or npm i) to install the dependencies, the examples can be run from the root folder like so:
4
5```sh
6NODE_PATH=../ node examples/search.js
7```
8
9# Tips & Tricks
10
11### Load a Chrome extension
12
13By default, Puppeteer disables extensions when launching Chrome. You can load a specific
14extension using:
15
16```js
17const browser = await puppeteer.launch({
18 headless: false,
19 args: [
20 '--disable-extensions-except=/path/to/extension/',
21 '--load-extension=/path/to/extension/',
22 ]
23});
24```
25
26# Other resources
27
28> Other useful tools, articles, and projects that use Puppeteer.
29
30## Rendering and web scraping
31- [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).
32- [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.
33- [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.
34- [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.
35- [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.
36
37## Testing
38- [angular-puppeteer-demo](https://github.com/Quramy/angular-puppeteer-demo) - Demo repository explaining how to use Puppeteer in Karma.
39- [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.