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.7k
My Journey as Technical Presenter
jecfish
0
920
Becoming a GDE
jecfish
0
3.7k
How to get started in IT Freelancing
jecfish
1
270
New Web API & Stylings
jecfish
3
680
如何打造高性能且SEO友好的单页应用(SPA)
jecfish
2
830
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
Enterprise Web App. Development (2): Version Control Tool Training Ver. 5.1
knakagawa
1
110
從零到一:搭建你的第一個 Observability 平台
blueswen
1
900
Bytecode Manipulation 으로 생산성 높이기
bigstark
1
310
エラーって何種類あるの?
kajitack
5
140
関数型まつり2025登壇資料「関数プログラミングと再帰」
taisontsukada
2
800
プロダクト開発でも使おう 関数のオーバーロード
yoiwamoto
0
150
既存デザインを変更せずにタップ領域を広げる方法
tahia910
1
210
無関心の谷
kanayannet
0
160
「ElixirでIoT!!」のこれまでとこれから
takasehideki
0
350
AWS CDKの推しポイント 〜CloudFormationと比較してみた〜
akihisaikeda
3
250
コード書くの好きな人向けAIコーディング活用tips #orestudy
77web
3
300
Cline指示通りに動かない? AI小説エージェントで学ぶ指示書の書き方と自動アップデートの仕組み
kamomeashizawa
1
480
Featured
See All Featured
Fashionably flexible responsive web design (full day workshop)
malarkey
407
66k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Building Better People: How to give real-time feedback that sticks.
wjessup
367
19k
Building a Scalable Design System with Sketch
lauravandoore
462
33k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
29
1.8k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
Balancing Empowerment & Direction
lara
1
300
Side Projects
sachag
455
42k
Testing 201, or: Great Expectations
jmmastey
42
7.5k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.4k
GraphQLとの向き合い方2022年版
quramy
46
14k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
30
2.1k
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