Created
December 31, 2013 15:35
-
-
Save t-ashula/8198460 to your computer and use it in GitHub Desktop.
node-phantom, phantom.js crash.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "node-phantom-test", | |
"version": "0.0.1", | |
"private": true, | |
"dependencies": { | |
"node-phantom": "~0.2.5", | |
"phantomjs": "~1.9.2-6" | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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