Skip to content

Instantly share code, notes, and snippets.

@kingofhawks
Last active April 21, 2019 12:51
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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