CaptureJS is full webpage capture command-line tool with PhantomJS.
First install PhantomJS.
$ npm install -g capturejs
Usage: capturejs [options]
URI
-u, --uri <value> (required)
Output Image File
-o, --output <value> (required)
Sets the SSL protocol for secure connections (default is SSLv3) (sslv3|sslv2|tlsv1|any)
-p, --ssl-protocol <value>
Ignores SSL errors (expired/self-signed certificate errors)
-I, --ignore-ssl-errors <value>
CSS Selector
-s, --selector <value>
UserAgent
-A, --user-agent <value>
Inject external script code on Web page
-J, --javascript-file <value>
ViewPortSize {width}x{height}
-V, --viewportsize <value>
Cookies File
-c, --cookies-file <value>
HTTP Timeout (ms)
-T, --timeout <value>
Render Delay (ms)
-R, --renderdelay <value>
% capturejs --uri http://phantomjs.org/ \
--selector '.header' \
--viewportsize 1400x1400 \
--output 'phantomjs.org.png'
% capturejs --uri http://phantomjs.org/ \
--selector '.header' \
--viewportsize 1400x1400 \
--javascript-file ./hidelogo.js \
--output 'phantomjs.org_hide_logo.png'
// hidelogo.js
document.querySelector('.header img').style.visibility = 'hidden';
Copyright (c) 2012 Kazuki Suda. See LICENSE.txt for further details.