PhantomJs: The best way to save rendered HTML page into an image file
Suppose you have an HTML page that overflows with scrollbars but you want to save the whole content into an image file. You don’t need to use canvas, CutyCapt, browser add-on, etc. PhantomJs is your new best friend: a headless webkit. Install and follow the quick start guide.
Then setup a simple JavaScript file, export, to load the webpage and save it in an image file:
var page = require('webpage').create();
page.open('http://amazon.com', function () {
page.render('export.png');
phantom.exit();
});
From a browser:

Then run the PhantomJs command:
macbook-pro:~/Downloads/phantomjs-1.7.0-macosx/bin>./phantomjs /tmp/export
which export the webpage to a long stretched image file:





