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
Headless Browser Experiments
Search
Christian Bäuerlein
January 28, 2016
Programming
430
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Headless Browser Experiments
A short journey about taking screenshots with headless browsers.
Christian Bäuerlein
January 28, 2016
More Decks by Christian Bäuerlein
See All by Christian Bäuerlein
Single File Ruby Programs @ RubyUnconf 2023
fabrik42
0
190
Single File Ruby Programs 2.0
fabrik42
1
230
Single File Ruby Programs
fabrik42
0
330
Agile Software Development for Software Developers
fabrik42
0
63
Phoenix Live View
fabrik42
0
650
Rails API-only considerations
fabrik42
0
400
Org-Mode
fabrik42
0
570
Flocking Simulation with Phoenix Channels
fabrik42
1
420
Cleaner, scalable views with object oriented components
fabrik42
0
390
Other Decks in Programming
See All in Programming
Built Our Own Background Agent at LayerX
layerx
PRO
10
5.4k
人間の目はかわらない、だからJPEGは30年もつ
yuzneri
12
18k
Terraform標準の組織で AWS CDKをどう使うか
mu7889yoon
1
510
「人を評価する AI」の設計と実装
ryoyanara
0
200
使いながら育てる Claude Code — 開発フローの1コマンド化 × 繰り返し指摘の自動仕組み化
shiki_kakaku
0
1.8k
Apache Hive: Toward a Cloud Native Lakehouse
okumin
0
190
夏だ!祭りだ!祭りとはドメインモデリングでは?
ryugen04
0
260
琵琶湖の水は止められてもNet--HTTPのリトライは止められない / You might be able to stop the water flow of Lake Biwa but you can't stop Net::HTTP retries
luccafort
PRO
0
690
php-fpmのプロセスが枯渇した日-調査・対処・そして本当にやるべきだったこと-
shibuchaaaan
0
280
Apache Hive: そしてCloud Native Lakehouseへ
okumin
1
220
【やさしく解説 設計編・中級 #6】良いアーキテクチャとは ~ 一本の登り道の、行き先 ~
panda728
PRO
0
210
生成AIで帳票OCRが「簡単に」作れる時代になった?
kon_shou
0
840
Featured
See All Featured
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
170
Building Applications with DynamoDB
mza
96
7.2k
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
380
Are puppies a ranking factor?
jonoalderson
1
3.8k
[RailsConf 2023] Rails as a piece of cake
palkan
59
6.9k
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
1
370
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
240
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
2
630
Thoughts on Productivity
jonyablonski
76
5.3k
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
300
Product Roadmaps are Hard
iamctodd
55
12k
Why Our Code Smells
bkeepers
PRO
340
58k
Transcript
HEADLESS BROWSER EXPERIMENTS A short journey about taking screenshots with
headless browsers Christian Bäuerlein / @fabrik42
A headless browser is a web browser without a graphical
user interface.
PhantomJS SlimerJS CasperJS many more!
USE CASES Running test suites Web scraping / Automation Taking
screenshots
TAKING SCREENSHOTS
The project: A desktop website that lets users create a
custom mobile web app.
The challenges: How to render a list of created apps?
How to share your creations with others?
HTML IS NOT SHAREABLE URLs are easy to share. Textual
content is easy to share. Visual representations in HTML are not easy to share. But images are :)
SCREENSHOTS!
None
None
PHANTOMJS 1.X Good Just one binary Not So Good Project
was somehow stalled Bad No web font support :(
PHANTOMJS 2.0! Including web font support! *yay* Let's try again...
PROBLEM Present your work on a web page to somebody
who can't access it right now.
RESPONSIVE MOCKUPS github.com/fabrik42/responsive_mockups
RESPONSIVE MOCKUPS Takes screenshots of a webpage in different resolutions
and automatically applies it to mockup templates.
None
None
None
REQUIREMENTS Easy to install. No dependencies, if possible. Nice templates
to start right away.
EASY INSTALLATION brew install phantomjs git clone [responsive_mockups] && cd
responsive_mockups phantomjs example.js
EXAMPLE.JS var mockup = require('./index'); mockup.create({ url: 'https://flinc.org/home', template: 'flat_responsive_2',
output: 'my_mockup.png' });
HOW IT WORKS 1. User provides URL and template name.
2. PhantomJS generates screenshots based on different viewports. 3. PhantomJS assembles mockup image using a local HTML file and <canvas>.
None
None
None
None
None
None
None
None
RESPONSIVE MOCKUPS github.com/fabrik42/responsive_mockups
Mockup graphics are nice, but what about... MOCKUP PHOTOS?
None
None
DEMO TIME!
http://phantomjs.org/supported-web-standards.html WebGL CSS 3D Video and Audio The following features,
due to the nature of PhantomJS, are irrelevant:
None
Atom Editor Visual Studio Code Slack Mapbox Map Designer ...
nightmare.js!
Knows how to WebGL :)
None
ONE MORE THING...
Now that we mastered all kind of images, what about...
MOVIES!
None
STOP MOTION IN HTML & JS Create an animation Stop
at every frame Make a screenshot Go to the next frame
DEMO TIME!
Remember: We wanted to make things shareable.
CUSTOMIZED MOVIES!
Manipulate the movie while rendering the frames browser .evaluate(function (currentFrame)
{ stage.goto(currentFrame); }, currentFrame)
ADVANCED DEMO TIME!
Q & A Christian Bäuerlein github.com/fabrik42 twitter.com/fabrik42
[email protected]