Skip to content

Instantly share code, notes, and snippets.

@zither
Created September 16, 2017 14:52
Show Gist options
  • Save zither/43f5eb3b8d8cf280b039c5d1f693c022 to your computer and use it in GitHub Desktop.
Save zither/43f5eb3b8d8cf280b039c5d1f693c022 to your computer and use it in GitHub Desktop.
phantomjs
// Usage: phantomjs c.js
var page = require('webpage').create();
var url = 'c.html';
page.open(url, function(status){
window.setTimeout(function () {
var height = page.evaluate(function(){
return document.body.scrollHeight;
});
page.clipRect = {top: 0, left: 0, width: 406, height: height};
page.render('c.png', {quality: 90});
phantom.exit();
}, 200);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment