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
240
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.4k
My Journey as Technical Presenter
jecfish
0
780
Becoming a GDE
jecfish
0
3.4k
How to get started in IT Freelancing
jecfish
1
250
New Web API & Stylings
jecfish
3
590
如何打造高性能且SEO友好的单页应用(SPA)
jecfish
2
700
JS SEO
jecfish
4
1.3k
Web Performance Optimization
jecfish
5
1.6k
Have Fun with Angular
jecfish
0
80
Other Decks in Programming
See All in Programming
Fragment Composition of GraphQL
quramy
14
1.7k
『WordPressコミュニティで学ぶ』OSS貢献の多様性
ippey
0
220
Amazon Aurora Serverless v2が意外と高かった話と、AWS Database Migration Serviceの話
satoshi256kbyte
1
110
TSKaigi 2024 - 新サービス Progate Path の演習で TypeScript を採用して見えた教材観点からの利点と課題
makotoshimazu
1
220
Next.js App Router
quramy
14
2.3k
CQRS meets modern Java
simas
PRO
2
470
TypeScriptのパフォーマンス改善
yajihum
14
5k
最近コードレビューで指摘したこと
forrep
3
110
TypeScriptとGraphQLで実現する 型安全なAPI実装 / TSKaigi 2024
hokaccha
5
2.7k
[RubyKaigi 2024] Ruby Mixology 101: adding shots of PHP, Elixir, and more
palkan
0
120
JavaScript Closure
asoluka
0
2k
“Seeing Like a Programmer”—Resiliency, Limits, and Moral Hazards in Software Engineering (LambdaConf 2024)
chriskrycho
0
430
Featured
See All Featured
Making Projects Easy
brettharned
109
5.5k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
34
6.1k
Designing for Performance
lara
601
67k
How GitHub (no longer) Works
holman
305
140k
How to Ace a Technical Interview
jacobian
273
22k
What the flash - Photography Introduction
edds
64
11k
Music & Morning Musume
bryan
41
5.6k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
358
22k
StorybookのUI Testing Handbookを読んだ
zakiyama
13
4.7k
The Cost Of JavaScript in 2023
addyosmani
21
4k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
242
1.2M
Bash Introduction
62gerente
605
210k
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