Skip to content

Instantly share code, notes, and snippets.

@magnusnordlander
Created August 21, 2012 07:45
Show Gist options
  • Save magnusnordlander/3413204 to your computer and use it in GitHub Desktop.
Save magnusnordlander/3413204 to your computer and use it in GitHub Desktop.
Take a screenshot with PhantomJS
var system = require('system');
//create new webpage object
var page = new WebPage();
//load the page
page.open(system.args[1], function (status) {
//fire callback to take screenshot after load complete
page.render(system.args[2]);
//finish
phantom.exit();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment