Created
June 5, 2014 00:29
-
-
Save charliepark/b42819ebac284df670b0 to your computer and use it in GitHub Desktop.
A demo Phantom.js script
This file contains hidden or 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 width = 320; | |
var height = 480; | |
var webpage = require('webpage'); | |
page = webpage.create(); | |
page.viewportSize = {width: width, height: height}; | |
page.open('https://ifttt.com', function(status) { | |
console.log(status); | |
page.evaluate(function(w, h) { | |
document.body.style.width = w + "px"; | |
document.body.style.height = h + "px"; | |
}, width, height); | |
page.clipRect = {top: 0, left: 0, width: width, height: height}; | |
page.render('example.png'); | |
phantom.exit(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment