Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
puppeteer
Search
Jecelyn Yeen
April 14, 2018
Programming
3
250
puppeteer
Google Chrome Puppeteer
Jecelyn Yeen
April 14, 2018
Tweet
Share
More Decks by Jecelyn Yeen
See All by Jecelyn Yeen
WorkerConf 2021 - Browser automation with Puppeteer
jecfish
0
1.8k
My Journey as Technical Presenter
jecfish
0
930
Becoming a GDE
jecfish
0
3.8k
How to get started in IT Freelancing
jecfish
1
270
New Web API & Stylings
jecfish
3
690
如何打造高性能且SEO友好的单页应用(SPA)
jecfish
2
840
JS SEO
jecfish
4
1.5k
Web Performance Optimization
jecfish
5
1.7k
Have Fun with Angular
jecfish
0
95
Other Decks in Programming
See All in Programming
可変性を制する設計: 構造と振る舞いから考える概念モデリングとその実装
a_suenami
2
570
型で語るカタ
irof
1
810
TypeScriptでDXを上げろ! Hono編
yusukebe
3
860
リッチエディターを安全に開発・運用するために
unachang113
1
240
変化を楽しむエンジニアリング ~ いままでとこれから ~
murajun1978
0
140
脱Riverpod?fqueryで考える、TanStack Queryライクなアーキテクチャの可能性
ostk0069
0
560
Google I/O Extended Incheon 2025 ~ What's new in Android development tools
pluu
1
120
ソフトウェア設計とAI技術の活用
masuda220
PRO
25
6.7k
AI時代の『改訂新版 良いコード/悪いコードで学ぶ設計入門』 / ai-good-code-bad-code
minodriven
24
10k
[SRE NEXT] 複雑なシステムにおけるUser Journey SLOの導入
yakenji
0
740
構文解析器入門
ydah
7
1.8k
What's new in AppKit on macOS 26
1024jp
0
170
Featured
See All Featured
Keith and Marios Guide to Fast Websites
keithpitt
411
22k
Testing 201, or: Great Expectations
jmmastey
43
7.6k
Making the Leap to Tech Lead
cromwellryan
134
9.4k
The World Runs on Bad Software
bkeepers
PRO
70
11k
Fashionably flexible responsive web design (full day workshop)
malarkey
407
66k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
47
9.6k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
8
710
jQuery: Nuts, Bolts and Bling
dougneiner
63
7.8k
Scaling GitHub
holman
461
140k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
10
990
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
53k
4 Signs Your Business is Dying
shpigford
184
22k
Transcript
Control your browser programmatically
@JecelynYeen From Kuala Lumpur, Malaysia - Google Developer Expert -
Web technologies, Angular - Software Architect @ Randstad - Organizer - Women Who Code KL
– Boss “Hey, send me a screenshot of www.competitor.com everyday.”
– Someone “If you perform a same task 10 times
repetitively, consider to automate it.”
Puppeteer - a node library which provide a high level
API to control headless Chrome or Chromium over the DevTools Protocol.
What can you do with Puppeteer? Most of the things
you do manually in the browser.
Use cases - Take screenshot - Generate PDF - Scrap
content - Automate UI testing - Timeline tracing - And more! Can - DDos Attack - Fake page loads - Credential stuffing - *Some page with audio & video Can’t
npm install puppeteer —save
Take screenshot
Generate PDF
Scrap content
Automate UI Testing
Time tracing
– Boss “Hey, send me a screenshot of www.competitor.com everyday.”
– Boss “Hey, send me screenshots of mobile, table and
desktop views of www.competitor.com everyday.”
Our use case @ Randstad PDF printing as a service
Dynamic form builder
Work Flow 1. Consultant select a form 2. Send the
form to candidate (email with url) 3. Candidate fill in the form & submit 4. Queue to process the form A. Generate PDF B. Attach PDF to email and send to candidate
PDF Printing as a service - Express + Puppeteer +
Cloud Storage - API - POST /pdf/print
Lighthouse - an automated tool for improving the quality of
web pages. *It uses Puppeteer! https://developers.google.com/web/tools/lighthouse/
How about running Puppeteer serverless-ly? https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md AWS Lambda
Gotchas - Wait for certain page element loaded - Deployment
- chromium version - Performance overhead
Additional Examples
None
None
Questions? Thank you. https://speakerdeck.com/chybie/puppeteer https://github.com/chybie/puppeteer-demo