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
970
Becoming a GDE
jecfish
0
3.8k
How to get started in IT Freelancing
jecfish
1
270
New Web API & Stylings
jecfish
3
720
如何打造高性能且SEO友好的单页应用(SPA)
jecfish
2
870
JS SEO
jecfish
4
1.6k
Web Performance Optimization
jecfish
5
1.8k
Have Fun with Angular
jecfish
0
110
Other Decks in Programming
See All in Programming
今こそ知るべき耐量子計算機暗号(PQC)入門 / PQC: What You Need to Know Now
mackey0225
3
370
CSC307 Lecture 09
javiergs
PRO
1
830
Data-Centric Kaggle
isax1015
2
760
IFSによる形状設計/デモシーンの魅力 @ 慶應大学SFC
gam0022
1
300
Implementation Patterns
denyspoltorak
0
280
AI & Enginnering
codelynx
0
110
インターン生でもAuth0で認証基盤刷新が出来るのか
taku271
0
190
「ブロックテーマでは再現できない」は本当か?
inc2734
0
550
コマンドとリード間の連携に対する脅威分析フレームワーク
pandayumi
1
450
Basic Architectures
denyspoltorak
0
660
2026年 エンジニアリング自己学習法
yumechi
0
130
AIエージェントのキホンから学ぶ「エージェンティックコーディング」実践入門
masahiro_nishimi
4
320
Featured
See All Featured
Producing Creativity
orderedlist
PRO
348
40k
Designing for Timeless Needs
cassininazir
0
130
Mobile First: as difficult as doing things right
swwweet
225
10k
Making Projects Easy
brettharned
120
6.6k
Why Our Code Smells
bkeepers
PRO
340
58k
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
54
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
122
21k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
231
22k
Bash Introduction
62gerente
615
210k
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
1
120
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
5.8k
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