I would like to use phantomjs in my node.js script. there is a phantomjs-node library.. but unfortunately the author used this weird coffee script code to explain what he\'s
I am now the new maintainer for phantom-node package. It doesn't use coffeescript anymore. You can do something like
var phantom = require('phantom');
phantom.create().then(function(ph) {
ph.createPage().then(function(page) {
page.open('https://stackoverflow.com/').then(function(status) {
console.log(status);
page.property('content').then(function(content) {
console.log(content);
page.close();
ph.exit();
});
});
});
});
The new version is much faster and resilient. It also doesn't use websockets anymore.