If I change this:
var phantom = require('phantom');
phantom.create(function(ph) {
return ph.createPage(function(page) {
return page.open("http://www.google.com", function(status) {
console.log("opened google? ", status);
return page.evaluate((function() {
return document.title;
}), function(result) {
console.log('Page title is ' + result);
return ph.exit();
});
});
});
});
to this:
var phantom = require('phantom');
phantom.create(function(ph) {
return ph.createPage(function(page) {
return page.open("http://www.google.com", function(status) {
console.log("opened google? ", status);
return page.get('title',(function(title) {
return title;
}), function(result) {
console.log('Page title is ' + result);
return ph.exit();
});
});
});
});
Node hangs at the console after printing 'opened google? success'and there is no further output.
I am trying to use page.get() instead of page.evaluate as described in the phantom module docs:
Properties can't be get/set directly, instead use p.get('version', callback)