Skip to content

Instantly share code, notes, and snippets.

@kingofhawks
Last active April 21, 2019 12:51
Show Gist options
  • Save kingofhawks/8553534 to your computer and use it in GitHub Desktop.
Save kingofhawks/8553534 to your computer and use it in GitHub Desktop.
Use phantomjs to automatically do screenshot for web pages
var page = require('webpage').create();
page.viewportSize = { width: 500, height: 300 };
page.open('http://github.com/', function() {
//page.render('github.png');
page.render('github.pdf');//support PDF render also
phantom.exit();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment