Created
February 19, 2016 22:38
-
-
Save netsi1964/8a90640d656262f6c636 to your computer and use it in GitHub Desktop.
Simple screenshoot script for 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(); | |
//viewportSize being the actual size of the headless browser | |
page.viewportSize = { width: 1024, height: 768 }; | |
//the clipRect is the portion of the page you are taking a screenshot of | |
page.clipRect = { top: 0, left: 0, width: 1024, height: 768 }; | |
//the rest of the code is the same as the previous example | |
page.open('http://www.netsi.dk/wordpress', function() { | |
page.render('netsi.png'); | |
phantom.exit(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment