Submit Search
Upload
Puppeteerのお話
•
1 like
•
358 views
S
Shinji Kobayashi
Follow
京都Devかふぇ#3でお話したときの資料です https://kyoto-dev-cafe.connpass.com/event/94676/
Read less
Read more
Technology
Report
Share
Report
Share
1 of 34
Download now
Download to read offline
Recommended
Deploying Apache Kylin on AWS and designing a task scheduler for it
Deploying Apache Kylin on AWS and designing a task scheduler for it
Chase Zhang
Kubernetes Story - Day 2: Quay.io Container Registry for Publishing, Building...
Kubernetes Story - Day 2: Quay.io Container Registry for Publishing, Building...
Mihai Criveti
Kubernetes Story - Day 3: Deploying and Scaling Applications on OpenShift
Kubernetes Story - Day 3: Deploying and Scaling Applications on OpenShift
Mihai Criveti
RKT
RKT
Yutaka Matsubara
Perspectives on Docker
Perspectives on Docker
RightScale
Dockerize Your Projects - A Brief Introduction to Containerization
Dockerize Your Projects - A Brief Introduction to Containerization
Sawood Alam
Drone CI/CD Platform
Drone CI/CD Platform
Bo-Yi Wu
DCSF 19 Deploying Rootless buildkit on Kubernetes
DCSF 19 Deploying Rootless buildkit on Kubernetes
Docker, Inc.
Recommended
Deploying Apache Kylin on AWS and designing a task scheduler for it
Deploying Apache Kylin on AWS and designing a task scheduler for it
Chase Zhang
Kubernetes Story - Day 2: Quay.io Container Registry for Publishing, Building...
Kubernetes Story - Day 2: Quay.io Container Registry for Publishing, Building...
Mihai Criveti
Kubernetes Story - Day 3: Deploying and Scaling Applications on OpenShift
Kubernetes Story - Day 3: Deploying and Scaling Applications on OpenShift
Mihai Criveti
RKT
RKT
Yutaka Matsubara
Perspectives on Docker
Perspectives on Docker
RightScale
Dockerize Your Projects - A Brief Introduction to Containerization
Dockerize Your Projects - A Brief Introduction to Containerization
Sawood Alam
Drone CI/CD Platform
Drone CI/CD Platform
Bo-Yi Wu
DCSF 19 Deploying Rootless buildkit on Kubernetes
DCSF 19 Deploying Rootless buildkit on Kubernetes
Docker, Inc.
Docker in production: reality, not hype (OSCON 2015)
Docker in production: reality, not hype (OSCON 2015)
bridgetkromhout
Lessons Learned: Using Concourse In Production
Lessons Learned: Using Concourse In Production
Shingo Omura
Developing and Deploying PHP with Docker
Developing and Deploying PHP with Docker
Patrick Mizer
Docker 導入:障礙與對策
Docker 導入:障礙與對策
William Yeh
Docker at Djangocon 2013 | Talk by Ken Cochrane
Docker at Djangocon 2013 | Talk by Ken Cochrane
dotCloud
Learn docker in 90 minutes
Learn docker in 90 minutes
Larry Cai
Docker summit 2015: 以 Docker Swarm 打造多主機叢集環境
Docker summit 2015: 以 Docker Swarm 打造多主機叢集環境
謝 宗穎
Drone CI/CD 自動化測試及部署
Drone CI/CD 自動化測試及部署
Bo-Yi Wu
Docker 101 @KACST Saudi HPC 2016
Docker 101 @KACST Saudi HPC 2016
Walid Shaari
Docker for (Java) Developers
Docker for (Java) Developers
Rafael Benevides
Docker
Docker
Cary Gordon
Hide your development environment and application in a container
Hide your development environment and application in a container
Johan Janssen
Running Django on Docker: a workflow and code
Running Django on Docker: a workflow and code
Danielle Madeley
Solving Real World Production Problems with Docker
Solving Real World Production Problems with Docker
Marc Campbell
Using Docker in the Real World
Using Docker in the Real World
Tim Haak
Docker for Developers - php[tek] 2017
Docker for Developers - php[tek] 2017
Chris Tankersley
Drupal in Libraries
Drupal in Libraries
Cary Gordon
HP Advanced Technology Group: Docker and Ansible
HP Advanced Technology Group: Docker and Ansible
Patrick Galbraith
[DockerCon 2019] Hardening Docker daemon with Rootless mode
[DockerCon 2019] Hardening Docker daemon with Rootless mode
Akihiro Suda
Dockerizing stashboard - Docker meetup at Twilio
Dockerizing stashboard - Docker meetup at Twilio
dotCloud
Chrome Dev Summit Summary 2013 part 1 - what’s hot ?
Chrome Dev Summit Summary 2013 part 1 - what’s hot ?
Sacha Leprêtre
WebGL Awesomeness
WebGL Awesomeness
Stephan Seidt
More Related Content
What's hot
Docker in production: reality, not hype (OSCON 2015)
Docker in production: reality, not hype (OSCON 2015)
bridgetkromhout
Lessons Learned: Using Concourse In Production
Lessons Learned: Using Concourse In Production
Shingo Omura
Developing and Deploying PHP with Docker
Developing and Deploying PHP with Docker
Patrick Mizer
Docker 導入:障礙與對策
Docker 導入:障礙與對策
William Yeh
Docker at Djangocon 2013 | Talk by Ken Cochrane
Docker at Djangocon 2013 | Talk by Ken Cochrane
dotCloud
Learn docker in 90 minutes
Learn docker in 90 minutes
Larry Cai
Docker summit 2015: 以 Docker Swarm 打造多主機叢集環境
Docker summit 2015: 以 Docker Swarm 打造多主機叢集環境
謝 宗穎
Drone CI/CD 自動化測試及部署
Drone CI/CD 自動化測試及部署
Bo-Yi Wu
Docker 101 @KACST Saudi HPC 2016
Docker 101 @KACST Saudi HPC 2016
Walid Shaari
Docker for (Java) Developers
Docker for (Java) Developers
Rafael Benevides
Docker
Docker
Cary Gordon
Hide your development environment and application in a container
Hide your development environment and application in a container
Johan Janssen
Running Django on Docker: a workflow and code
Running Django on Docker: a workflow and code
Danielle Madeley
Solving Real World Production Problems with Docker
Solving Real World Production Problems with Docker
Marc Campbell
Using Docker in the Real World
Using Docker in the Real World
Tim Haak
Docker for Developers - php[tek] 2017
Docker for Developers - php[tek] 2017
Chris Tankersley
Drupal in Libraries
Drupal in Libraries
Cary Gordon
HP Advanced Technology Group: Docker and Ansible
HP Advanced Technology Group: Docker and Ansible
Patrick Galbraith
[DockerCon 2019] Hardening Docker daemon with Rootless mode
[DockerCon 2019] Hardening Docker daemon with Rootless mode
Akihiro Suda
Dockerizing stashboard - Docker meetup at Twilio
Dockerizing stashboard - Docker meetup at Twilio
dotCloud
What's hot
(20)
Docker in production: reality, not hype (OSCON 2015)
Docker in production: reality, not hype (OSCON 2015)
Lessons Learned: Using Concourse In Production
Lessons Learned: Using Concourse In Production
Developing and Deploying PHP with Docker
Developing and Deploying PHP with Docker
Docker 導入:障礙與對策
Docker 導入:障礙與對策
Docker at Djangocon 2013 | Talk by Ken Cochrane
Docker at Djangocon 2013 | Talk by Ken Cochrane
Learn docker in 90 minutes
Learn docker in 90 minutes
Docker summit 2015: 以 Docker Swarm 打造多主機叢集環境
Docker summit 2015: 以 Docker Swarm 打造多主機叢集環境
Drone CI/CD 自動化測試及部署
Drone CI/CD 自動化測試及部署
Docker 101 @KACST Saudi HPC 2016
Docker 101 @KACST Saudi HPC 2016
Docker for (Java) Developers
Docker for (Java) Developers
Docker
Docker
Hide your development environment and application in a container
Hide your development environment and application in a container
Running Django on Docker: a workflow and code
Running Django on Docker: a workflow and code
Solving Real World Production Problems with Docker
Solving Real World Production Problems with Docker
Using Docker in the Real World
Using Docker in the Real World
Docker for Developers - php[tek] 2017
Docker for Developers - php[tek] 2017
Drupal in Libraries
Drupal in Libraries
HP Advanced Technology Group: Docker and Ansible
HP Advanced Technology Group: Docker and Ansible
[DockerCon 2019] Hardening Docker daemon with Rootless mode
[DockerCon 2019] Hardening Docker daemon with Rootless mode
Dockerizing stashboard - Docker meetup at Twilio
Dockerizing stashboard - Docker meetup at Twilio
Similar to Puppeteerのお話
Chrome Dev Summit Summary 2013 part 1 - what’s hot ?
Chrome Dev Summit Summary 2013 part 1 - what’s hot ?
Sacha Leprêtre
WebGL Awesomeness
WebGL Awesomeness
Stephan Seidt
Introduction to Robot Framework
Introduction to Robot Framework
Somkiat Puisungnoen
vodQA Pune (2019) - Browser automation using dev tools
vodQA Pune (2019) - Browser automation using dev tools
vodQA
Chrome Devtools Protocol via Selenium/Appium (Japanese)
Chrome Devtools Protocol via Selenium/Appium (Japanese)
Kazuaki Matsuo
Puppeteer - Headless Chrome Node API
Puppeteer - Headless Chrome Node API
ubunturk
Intro to Puppeteer
Intro to Puppeteer
Islam AlZatary
GOTO Paris | @see Gopher
GOTO Paris | @see Gopher
Jan Klat
Phonegap for Engineers
Phonegap for Engineers
Brian LeRoux
Introduction to Git, DrupalCamp LA 2015
Introduction to Git, DrupalCamp LA 2015
mwrather
Chrome Devtools Protocol via Selenium/Appium (English)
Chrome Devtools Protocol via Selenium/Appium (English)
Kazuaki Matsuo
GDD Brazil 2010 - What's new in Google App Engine and Google App Engine For B...
GDD Brazil 2010 - What's new in Google App Engine and Google App Engine For B...
Patrick Chanezon
Codecoon - A technical Case Study
Codecoon - A technical Case Study
Michael Lihs
Kubeflow Development Environment
Kubeflow Development Environment
Weiqiang Zhuang
Have I Been Pwned and Cloudflare
Have I Been Pwned and Cloudflare
StefnJkullSigurarson1
Full stack-web-design
Full stack-web-design
Kevin Conboy
Web rtc 入門
Web rtc 入門
crsgypin Chiu
Chromecast, CheapCast and TV - DevFest Brussels 2013
Chromecast, CheapCast and TV - DevFest Brussels 2013
Sebastian Mauer
Recap of the google io 2017
Recap of the google io 2017
Karan Trehan
Frontend SPOF
Frontend SPOF
Patrick Meenan
Similar to Puppeteerのお話
(20)
Chrome Dev Summit Summary 2013 part 1 - what’s hot ?
Chrome Dev Summit Summary 2013 part 1 - what’s hot ?
WebGL Awesomeness
WebGL Awesomeness
Introduction to Robot Framework
Introduction to Robot Framework
vodQA Pune (2019) - Browser automation using dev tools
vodQA Pune (2019) - Browser automation using dev tools
Chrome Devtools Protocol via Selenium/Appium (Japanese)
Chrome Devtools Protocol via Selenium/Appium (Japanese)
Puppeteer - Headless Chrome Node API
Puppeteer - Headless Chrome Node API
Intro to Puppeteer
Intro to Puppeteer
GOTO Paris | @see Gopher
GOTO Paris | @see Gopher
Phonegap for Engineers
Phonegap for Engineers
Introduction to Git, DrupalCamp LA 2015
Introduction to Git, DrupalCamp LA 2015
Chrome Devtools Protocol via Selenium/Appium (English)
Chrome Devtools Protocol via Selenium/Appium (English)
GDD Brazil 2010 - What's new in Google App Engine and Google App Engine For B...
GDD Brazil 2010 - What's new in Google App Engine and Google App Engine For B...
Codecoon - A technical Case Study
Codecoon - A technical Case Study
Kubeflow Development Environment
Kubeflow Development Environment
Have I Been Pwned and Cloudflare
Have I Been Pwned and Cloudflare
Full stack-web-design
Full stack-web-design
Web rtc 入門
Web rtc 入門
Chromecast, CheapCast and TV - DevFest Brussels 2013
Chromecast, CheapCast and TV - DevFest Brussels 2013
Recap of the google io 2017
Recap of the google io 2017
Frontend SPOF
Frontend SPOF
Recently uploaded
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
Enterprise Knowledge
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
Delhi Call girls
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Drew Madelung
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
ThousandEyes
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
apidays
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
Anna Loughnan Colquhoun
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
The Digital Insurer
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Neo4j
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
Principled Technologies
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
sudhanshuwaghmare1
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
Gabriella Davis
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
The Digital Insurer
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
The Digital Insurer
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
Product Anonymous
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
Antenna Manufacturer Coco
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
Maria Levchenko
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
Enterprise Knowledge
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
ThousandEyes
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
hans926745
Recently uploaded
(20)
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
Puppeteerのお話
1.
Puppeteer Dev #3 @kobashinG
2.
Agenda • Puppeteer 🤔 •
Puppeteer 🐣 • Puppeteer E2E 🐌
3.
• 👀 > 🙇 •
E2E 🙊
4.
Web
5.
• • Alexa 🙇🙇🙇
6.
Puppeteer 🤔
7.
Kotlin https://youtu.be/lhZOFUY1weo
8.
Puppeteer Headless Chrome Chrome Devtools Protocols Headless Chrome • •
Websocket port:9222
9.
Headless Chrome Chrome Devtools Protocols CDP • Devtools
API • Json Puppeteer
10.
Headless Chrome Chrome Devtools Protocols Puppeteer • API •
Test • Puppeteer
11.
Google I/O 2018
Puppeteer Session I/O • Keyboard & Touch & Mouse • Page ScreenShot & PDF • Create PDF • Running Headless in the Cloud • A/B Testing & Network interception • SSR/Pre-Rendering • Google Crower
12.
Hack A/B Testing &
Network Interception Cloud BFF Backend, … etc
13.
Hack ? A/B Testing
& Network Interception Cloud BFF Backend, … etc Proxy-Server SSR A/B Testing
14.
🐥 Puppeteer 🐣
15.
$ npm i
puppeteer $ npm i puppeteer-core Install puppeteer Chromium puppeteer-core
16.
Screenshot
17.
import * as
puppeteer from 'puppeteer' (async () => { const browser = await puppeteer.launch(); const page = await browser.newPage(); await page.goto('https://yahoo.co.jp'); await page.screenshot({ path: ‘out/yahoo.png’, fullPage: true }); await browser.close(); })(); Take a Screenshot
18.
Select Dom &
Screenshot
19.
const browser =
await puppeteer.launch(); const page = await browser.newPage(); await page.goto(`https://twitter.com/xxxx`); const tweet = await page.$( ‘.tweet.permalink-tweet' ); await tweet.screenshot({ path: 'out/tweet.png' }); await browser.close(); Select Dom & Screenshot
20.
📷 📸
21.
Create a PDF
22.
(async () =>
{ const browser = await puppeteer.launch(); const page1 = await browser.newPage(); await page1.goto('https://yahoo.co.jp'); await page1.pdf({path: 'out/yahoo.pdf'}); await page1.close(); })(); Create a PDF
23.
const browser =
await puppeteer.launch(); const page2 = await browser.newPage(); await page2.setContent(` <!DOCTYPE html> <html> <head> <style>… HTML PDF `); await page2.pdf({path: 'out/sample.pdf'}); await browser.close(); Create a PDF
24.
Navigate Page
25.
const page =
await browser.newPage(); await page.goto(`https://twitter.com/xxxx`); await page.$eval( `.tweet[data-screen-name=“kobashinG"]`, (tweet: HTMLElement) => tweet.click() ); await page.waitForSelector( ‘.tweet.permalink-tweet', {visible: true} ); Navigate Page
26.
Keyboard Input
27.
await page.goto('https://google.com'); await page.keyboard.type('
'); const [response] = await Promise.all([ page.waitForNavigation(), // page.click('#srchbtn') page.keyboard.press('Enter') ]); Keyboard Input
28.
* Puppeteer with
Jest 🎉 Puppeteer E2E 🐌
29.
"jest": { "preset": "jest-puppeteer", Install
& Configuration TypeScript $ npm i jest jest-puppeteer jest-image-snapshot ts-jest @types/jest
30.
$ npm i
jest jest-puppeteer jest-image-snapshot $ npm i ts-jest @types/jest @types/puppeteer @types/jest-environment-puppeteer @types/expect-puppeteer Install TypeScript
31.
describe("Google", () =>
{ beforeAll(async () => { await page.goto('https://google.com'); }); it('should display "google" text on page’, async () => { await expect(page).toMatch(‘google') }) }) Hello World ,
32.
describe("Google", () =>
{ beforeAll(async () => { await page.goto('https://google.com'); }); it('should display "google" text on page’, async () => { await expect(page).toMatch(‘google') }) }) E2E , Modern Frontend Test 🤩
33.
🐥 🐣 • Puppeteer
🐌 • Headless Chrome 🎉
34.
🙇
Download now