puppeteer/examples

Use case-driven examples for using Puppeteer and headless chrome

JavaScript

2,416

108 commits

updated Jun 21, 2026

See the code

README

Useful Puppeteer demos!

Examples for using Puppeteer to do big, bold things.

Output from some of the examples:

code_coverage.js

Test lazy loading strategy by seeing CSS/JS code coverage usage across page load.

screen shot 2018-02-26 at 10 20 41 am

verify_sw_caching.js

Verify all the resources you expect are being cached by a service worker for offline.

screen shot 2018-03-01 at 5 09 32 pm

google_search_features.js

Gut check your page to make sure it renders correctly for Google Search.

screen shot 2018-03-07 at 12 50 32 pm

lazyimages_without_scroll_events.js

Determine if your lazy loaded images will be seen correctly by Google Search.

screen shot 2018-10-09 at 12 15 10 pm

speech.js

Make your browser talk.

Speech demo in action

pacman.js

Play the Google Pac-Man Doodle.

ePlaying Puppeteer Pacman

element-to-pdf.js

Turn a DOM element into a PDF.

elemen-to-pdf output example

crawlsite.js

Discover all the URLs on a site and visualize the subpages.

Crawl a site/SPA

side-by-side-pageload.js

Load 2 or more pages side-by-side to visually see the difference in page load. Optional desktop viewport and throttling settings.

Side by side page load

License

Apache 2.0 © 2018 Google Inc.

automation
browser-testing
browser-tools
demos
puppeteer

puppeteer/examples

Use case-driven examples for using Puppeteer and headless chrome

JavaScript

2,416

108 commits

updated Jun 21, 2026

See the code

README

Useful Puppeteer demos!

Examples for using Puppeteer to do big, bold things.

Output from some of the examples:

code_coverage.js

Test lazy loading strategy by seeing CSS/JS code coverage usage across page load.

screen shot 2018-02-26 at 10 20 41 am

verify_sw_caching.js

Verify all the resources you expect are being cached by a service worker for offline.

screen shot 2018-03-01 at 5 09 32 pm

google_search_features.js

Gut check your page to make sure it renders correctly for Google Search.

screen shot 2018-03-07 at 12 50 32 pm

lazyimages_without_scroll_events.js

Determine if your lazy loaded images will be seen correctly by Google Search.

screen shot 2018-10-09 at 12 15 10 pm

speech.js

Make your browser talk.

Speech demo in action

pacman.js

Play the Google Pac-Man Doodle.

ePlaying Puppeteer Pacman

element-to-pdf.js

Turn a DOM element into a PDF.

elemen-to-pdf output example

crawlsite.js

Discover all the URLs on a site and visualize the subpages.

Crawl a site/SPA

side-by-side-pageload.js

Load 2 or more pages side-by-side to visually see the difference in page load. Optional desktop viewport and throttling settings.

Side by side page load

License

Apache 2.0 © 2018 Google Inc.

automation
browser-testing
browser-tools
demos
puppeteer

Project health

Overall

2.4/10

Maintained

0/10

Code review

1/10
OpenSSF Scorecard

Significant stargazers

Travis Cline

1,976 followers · starred Jan 2020

Juriy Zaytsev

3,401 followers · starred Apr 2018

Michael Stramel

110 followers · starred Mar 2018

Toru Kobayashi

663 followers · starred May 2018