Skip to content

Instantly share code, notes, and snippets.

@iwek
Created October 21, 2012 18:55
Show Gist options
  • Save iwek/3928084 to your computer and use it in GitHub Desktop.
Save iwek/3928084 to your computer and use it in GitHub Desktop.
document json
//phantomjs
var page = require('webpage').create();
var url = 'http://instagram.com/';
page.open(url, function (status) {
var js = page.evaluate(function () {
return document;
});
console.log(JSON.stringify(js));
phantom.exit();
});
//casperjs
var casper = require('casper').create();
var url = 'http://instagram.com/';
casper.start(url, function() {
var js = this.evaluate(function() {
return document;
});
this.echo(JSON.stringify(js));
});
casper.run();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment