Skip to content

Instantly share code, notes, and snippets.

@muffl0n
Created June 3, 2015 07:13
Show Gist options
  • Save muffl0n/976b5d99b2128997d97e to your computer and use it in GitHub Desktop.
Save muffl0n/976b5d99b2128997d97e to your computer and use it in GitHub Desktop.
phantomjs
var args = require('system').args;
var webpage = require('webpage');
var page = webpage.create();
var url = args[1];
page.viewportSize = {
width: 1024,
height: 768
};
page.open(url, function () {
console.log(page.renderBase64('PNG'));
phantom.exit();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment