public
Created

phantomjs context

  • Download Gist
phantom_context
1 2 3 4 5 6 7 8 9 10 11
var page = require('webpage').create();
page.onConsoleMessage = function (msg) {
console.log('Page title is ' + msg);
};
page.open(url, function (status) {
//-= DOM is not accessible here...
page.evaluate(function () {
//-= DOM is accessible here, who knew?!? :O
console.log(document.title);
});
});

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.