Create a gist now

Instantly share code, notes, and snippets.

phantomjs context
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);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment