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
950
Becoming a GDE
jecfish
0
3.8k
How to get started in IT Freelancing
jecfish
1
270
New Web API & Stylings
jecfish
3
700
如何打造高性能且SEO友好的单页应用(SPA)
jecfish
2
850
JS SEO
jecfish
4
1.5k
Web Performance Optimization
jecfish
5
1.8k
Have Fun with Angular
jecfish
0
100
Other Decks in Programming
See All in Programming
AI 駆動開発におけるコミュニティと AWS CDK の価値
konokenj
5
320
퇴근 후 1억이 거래되는 서비스 만들기 | 내가 AI를 사용하는 방법
maryang
2
360
マンガアプリViewerの大画面対応を考える
kk__777
0
440
Developer Joy - The New Paradigm
hollycummins
1
400
Inside of Swift Export
giginet
PRO
1
310
AIと人間の共創開発!OSSで試行錯誤した開発スタイル
mae616
2
870
CSC305 Lecture 12
javiergs
PRO
0
250
Dive into Triton Internals
appleparan
0
420
GC25 Recap: The Code You Reviewed is Not the Code You Built / #newt_gophercon_tour
mazrean
0
140
Webサーバーサイド言語としてのRustについて
kouyuume
1
5k
AsyncSequenceとAsyncStreamのプロポーザルを全部読む!!
s_shimotori
1
230
pnpm に provenance のダウングレード を検出する PR を出してみた
ryo_manba
1
170
Featured
See All Featured
Documentation Writing (for coders)
carmenintech
76
5.1k
Faster Mobile Websites
deanohume
310
31k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
46
7.8k
Product Roadmaps are Hard
iamctodd
PRO
55
11k
A Tale of Four Properties
chriscoyier
161
23k
Designing for humans not robots
tammielis
254
26k
A better future with KSS
kneath
239
18k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
285
14k
Fashionably flexible responsive web design (full day workshop)
malarkey
407
66k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.2k
The Invisible Side of Design
smashingmag
302
51k
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