-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cant get it to work with phantomjs #10
Comments
I'm seeing nearly the same errors.
I can use node and x-ray to look at static webpages. I really like the x-ray interface. Unfortunately for dynamically created content, that just won't work. I'm at a loss. I'm guessing this entire module was written to take advantage of a phantomjs wrapper (sockets?) but phantomjs in its current form doesn't support? Er, wait just a moment! does this module require https://github.com/amir20/phantomjs-node (PhantomJS integration module for NodeJS, I would call this a Bridge module..and its installed via Suggestion: What ever the right tools are, can we get a hint added to the readme.md page to tell us what's what? |
@zipzit Did you solve this? |
Er, no.. When you hit a brick wall, turn right. I was never able to understand when I'm running Phantom as a tool (like NPM or Node) or as a module. Frankly I'm new to this game, and I got lost in the different versions of what supports what. For my project, I'm lucky in that the data I'm scraping is generated static from the server. I was hoping to write a generic tool that would allow me to scrape JavaScript deployed content on a page, and I was hoping to use this tool to gain a bit of understanding. I failed. |
I just fixed this by installing from phantomjs.org. Add the /bin folder to your system PATH. I guess the standalone is required by the npm module. The npm module runs the "phantom" command from your PATH. |
Can you please details how exactly you solved it ? i have similar problem, trying to run PhantomJS with a logging module (https://github.com/Xsmael/node-logger) which bin folder is did you add to the PATH ? and what is that "standalone" ? |
This module has anything to do with phantomjs. If you look at its code, it uses Nightmare which uses Electron underneath. Electron is an alternative to phantoms. Actually, Nightmare used to depend on phantomjs, but they switched to Electron. |
I had the same problem in here. |
Same for me . |
Same here. Trying to use with deathbycaptcha module. Gives the following errors: |
When I am using phantomjs without xray it works great.
When I am using the example:
var phantom = require('x-ray-phantom');
var Xray = require('x-ray');
var x = Xray()
.driver(phantom());
x('http://google.com', 'title')(function(err, str) {
if (err) return done(err);
assert.equal('Google', str);
done();
})
and run it with phantomjs test.js
I get the following error:
Error: Cannot find module 'tty'
phantomjs://bootstrap.js:289
phantomjs://bootstrap.js:254 in require
C:/Users/Gebruiker/node_modules/x-ray-phantom/node_modules/debug/node.js:6
C:/Users/Gebruiker/node_modules/x-ray-phantom/node_modules/debug/node.js:210
TypeError: '[object Object]' is not a function (evaluating 'require('debug')('x-
ray:phantom')')
C:/Users/Gebruiker/node_modules/x-ray-phantom/index.js:5
C:/Users/Gebruiker/node_modules/x-ray-phantom/index.js:93
TypeError: 'undefined' is not a function (evaluating 'phantom.loadModule(code, t
his.filename)')
phantomjs://bootstrap.js:272
phantomjs://bootstrap.js:125
phantomjs://bootstrap.js:268
phantomjs://bootstrap.js:301
phantomjs://bootstrap.js:254 in require
phantest.js:2
The text was updated successfully, but these errors were encountered: