Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Take a screenshot of any tweet using Casper.js
var url = phantom.casperArgs.args[0]
var output = phantom.casperArgs.args[0]
var casper = require('casper').create({
pageSettings : {
userAgent : 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_2) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.79 Safari/535.11'
}
});
casper.start(url, function() {
this.captureSelector( output + '.png', '.permalink-inner .tweet');
});
casper.run();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment