Skip to content

Instantly share code, notes, and snippets.

@t-ashula
Created December 31, 2013 15:35
Show Gist options
  • Save t-ashula/8198460 to your computer and use it in GitHub Desktop.
Save t-ashula/8198460 to your computer and use it in GitHub Desktop.
node-phantom, phantom.js crash.
{
"name": "node-phantom-test",
"version": "0.0.1",
"private": true,
"dependencies": {
"node-phantom": "~0.2.5",
"phantomjs": "~1.9.2-6"
}
}
var phantom = require('node-phantom'), phantomPath = require('phantomjs').path;
var url = 'http://docs.sencha.com/extjs/4.2.1/';
console.log(phantomPath);
phantom.create(function (err, ph) {
return ph.createPage(function (err, page) {
return page.open(url, function (err, status) {
console.log("opened site? ", status);
return page.evaluate(function () {
return navigator.userAgent;
}, function (err, result) {
console.log(result);
ph.exit();
});
});
});
}, { phantomPath:phantomPath } );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment