Created
August 3, 2014 08:40
-
-
Save foo9/eb8c617e15c9071dcaca to your computer and use it in GitHub Desktop.
phantomjs capture.js
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 system = require('system'); | |
var url = system.args[1]; | |
var page = require('webpage').create(); | |
page.viewportSize = { width: 1024, height: 800 }; | |
page.open(url, function(status) { | |
if (status === 'success') { | |
setTimeout(function() { | |
page.evaluate(function() { | |
document.body.style.backgroundColor = 'white'; | |
}); | |
page.render('screen.png'); | |
phantom.exit(); | |
}, 1000); | |
} else { | |
phantom.exit(); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment