shotty
Take screenshots with a simple command line tool! It comes with phantomjs, chrome and firefox. If you want to use also safari webdriver, download the extension from here.
Getting started
Install imagemagick and graphicsmagick:
brew install imagemagick graphicsmagick
Install shotty globally:
npm install -g shotty
How to use it
shotty -h google.com apple.com -d ~/Desktop/screenshot
or
shotty -h localhost -p 8080 -d ~/Desktop/screenshot
nodeJS API
var Shotty = ;var shotty = ; shotty ;
or
var Shotty = ; var settings = browsers: browsers breakpoints: breakpoints wait: wait urls: urls port: port file: file dest: dest nocrop: true; var shotty = settings;
CLI Options
version
Show version number
-v, --version
url
required
Set the url or urls. It's an array, just add the urls using spaces.
i.e. -u google.com apple.com
-u, --url
port
Set port number
-p, --port
file
Set file path
-f, --file
dest
Choose where to save the screenshots, default: "/tmp"
-d, --dest
browser
Set browser: chrome, firefox, safari, phantomjs, all. Default: "phantomjs"
-b, --browser
size
Set breakpoints, array. Default: ["320x480","768x1024","1200x800"]
i.e. -s 320x480 768x1024
-s, --size
wait
Waiting time before taking the screenshot, default: 0
-w, --wait
nocrop
Save the image without cropping the height (only PhantomJS/Firefox)
-n, --nocrop
help
Show help
-h, --help
Known issues
- With Chrome and Safari is not possible to take a screenshot where the height is more than the screen resolution height
- PhantomJS sometimes returns an empty image