Comments (21)
Anyone have any ideas?
I rebuilt my instance and re-installed node and scraper. Same issue
from node-scraper.
I'm having the same issue :(
from node-scraper.
It seems this issue started around the same time as 'request' was moved to a different tree. Are there any hard-coded links in scraper?
from node-scraper.
The issue seems to be with jsdom. An issue has already been raised here https://github.com/tmpvar/jsdom/issues#issue/149
from node-scraper.
Seems jsdom defaults to:
jQueryTag.src = path || 'http://code.jquery.com/jquery-latest.js';
and that doesn't work all as it is now. I therefore reverted to a local 1.3.2 version of jQuery.
It also seems to break on script tags in the supplied source so to prevent that I temporarily do:
body = body.replace(/<(\/?)script/g, '<$1nobreakage');
from node-scraper.
So if it was not working for you before, update (new version on npm) and it should work.
from node-scraper.
Interesting, thanks for the suggestion, but even with the latest version (0.08) it fails.
Also, it seems jQueryTag.src = path || 'http://code.jquery.com/jquery-latest.js'; should be valid
from node-scraper.
I raised the issue with jsdom
from node-scraper.
In your code I noticed:
'/../deps/jquery-1.3.2.js'
so I added a local copy of jquery 1.3.2 and still same error.
from node-scraper.
I got my own jquery scraping thing working last night by doing something similar to this:
https://github.com/chriso/node.io/blob/master/lib/node.io/dom.js#L49
not sure if that helps...
cheers!
from node-scraper.
jquery-1.3.2.js is already added in the project so you shouldn't have to add it on your own.
I'm not having any issues so a stack trace would be helpful.
from node-scraper.
TypeError: Cannot read property 'prototype' of undefined
at /usr/local/lib/node/.npm/jsdom/0.2.0/package/lib/jsdom/browser/index.js:84:16
at String. ([object Context]:2500:12)
at Function.each ([object Context]:692:29)
at Object.add ([object Context]:2478:10)
at [object Context]:2907:17
at Function.each ([object Context]:692:29)
at Object.each ([object Context]:155:17)
at Object.one ([object Context]:2906:15)
at Object.bind ([object Context]:2896:34)
at [object Context]:3106:18
at [object Context]:4376:2
at Object.javascript (/usr/local/lib/node/.npm/jsdom/0.2.0/package/lib/jsdom/level2/languages/javascript.js:17:14)
at Object._eval (/usr/local/lib/node/.npm/jsdom/0.2.0/package/lib/jsdom/level2/html.js:1195:46)
at /usr/local/lib/node/.npm/jsdom/0.2.0/package/lib/jsdom/level2/html.js:43:20
at Object.check (/usr/local/lib/node/.npm/jsdom/0.2.0/package/lib/jsdom/level2/html.js:235:34)
at /usr/local/lib/node/.npm/jsdom/0.2.0/package/lib/jsdom/level2/html.js:251:12
at [object Object]. (fs.js:86:5)
at [object Object].emit (events.js:39:17)
at afterRead (fs.js:843:12)
TypeError: undefined is not a function
at CALL_NON_FUNCTION (native)
at /usr/local/lib/node/.npm/scraper/0.0.8/package/lib/scraper.js:58:7
at /usr/local/lib/node/.npm/jsdom/0.2.0/package/lib/jsdom.js:151:30
at Object. (/usr/local/lib/node/.npm/jsdom/0.2.0/package/lib/jsdom/level2/events.js:274:17)
at Object.dispatchEvent (/usr/local/lib/node/.npm/jsdom/0.2.0/package/lib/jsdom/level2/html.js:415:55)
at /usr/local/lib/node/.npm/jsdom/0.2.0/package/lib/jsdom/level2/html.js:56:15
at Object.check (/usr/local/lib/node/.npm/jsdom/0.2.0/package/lib/jsdom/level2/html.js:235:34)
at /usr/local/lib/node/.npm/jsdom/0.2.0/package/lib/jsdom/level2/html.js:251:12
at [object Object]. (fs.js:86:5)
at [object Object].emit (events.js:39:17)
from node-scraper.
And what example do you run to get that result? Or what code.
from node-scraper.
I'm using your demo code:
var scraper = require('scraper');
scraper('http://search.twitter.com/search?q=javascript', function(err, jQuery) {
if (err) {throw err}
jQuery('.msg').each(function() {
console.log(jQuery(this).text().trim()+'\n');
});
});
from node-scraper.
I just rebuilt my server and installed node and scraper (0.0.8) from scratch
from node-scraper.
Hmm I can not reproduce that error.
from node-scraper.
Interesting...
I'm using [email protected]
[email protected]
[email protected]
I'll try to use the "advanced" demo code and see if I can replicate it.
from node-scraper.
I'm running
[email protected]
[email protected]
What versions are you running?
from node-scraper.
node v0.4.1
npm 0.3.9
from node-scraper.
I downgraded to
[email protected]
still the same error.
TypeError: Cannot read property 'prototype' of undefined
My server is running on rackspace cloud, but I've successfully used scraper before.
from node-scraper.
I got the error as well. Here is my setup:
node v0.4.1
npm 0.3.9
I am using the latest scraper version installed via npm. I would appreciate some help.
from node-scraper.
Related Issues (20)
- Getting css background-image HOT 1
- Incatchable errors HOT 1
- How to add a url to scrap? HOT 3
- How do I know the parsed url?
- README.md has bad link to request
- FATAL ERROR: CALL_AND_RETRY_2 Allocation failed - process out of memory HOT 2
- Array access doesn't seem to work?
- A way to know when all scraper requests have completed for the entire process? HOT 1
- Text not scraped, but on the demo site it works!
- how to get http code
- trying to fetch ñ.ñ
- jsdom.jQueryify() not passing correct directory syntax on Windows node environments
- Undefined function error in Node.js v0.12
- How Do You Use This? HOT 1
- doesn't work with jsdom 0.2.0 HOT 15
- Charset ?? HOT 1
- Parallel scraping results in misses & duplicates HOT 4
- Final Callback HOT 1
- Remote error: TypeError: Cannot read property '_ownerDocument' of undefined HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-scraper.