Last active
August 29, 2015 14:21
-
-
Save edysegura/a2c9324ca70bed5502d3 to your computer and use it in GitHub Desktop.
[JS] Take a snapshot with PhantomJS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var page = require('webpage').create(); | |
page.open('http://edysegura.com', function () { | |
var title = page.evaluate(function () { | |
return document.title; | |
}); | |
page.clipRect = { top: 0, left: 0, width: 600, height: 700 }; | |
page.render(title + ".png"); | |
phantom.exit(); | |
}); | |
//to run just do the command below | |
//# phantomjs screenshot.js |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment