GithubHelp home page GithubHelp logo

Comments (21)

abhinavxrai avatar abhinavxrai commented on July 19, 2024

Anyone have any ideas?
I rebuilt my instance and re-installed node and scraper. Same issue

from node-scraper.

fat avatar fat commented on July 19, 2024

I'm having the same issue :(

from node-scraper.

abhinavxrai avatar abhinavxrai commented on July 19, 2024

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.

mape avatar mape commented on July 19, 2024

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.

mape avatar mape commented on July 19, 2024

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.

mape avatar mape commented on July 19, 2024

So if it was not working for you before, update (new version on npm) and it should work.

from node-scraper.

abhinavxrai avatar abhinavxrai commented on July 19, 2024

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.

abhinavxrai avatar abhinavxrai commented on July 19, 2024

I raised the issue with jsdom

from node-scraper.

abhinavxrai avatar abhinavxrai commented on July 19, 2024

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.

fat avatar fat commented on July 19, 2024

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.

mape avatar mape commented on July 19, 2024

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.

abhinavxrai avatar abhinavxrai commented on July 19, 2024

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.

mape avatar mape commented on July 19, 2024

And what example do you run to get that result? Or what code.

from node-scraper.

abhinavxrai avatar abhinavxrai commented on July 19, 2024

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.

abhinavxrai avatar abhinavxrai commented on July 19, 2024

I just rebuilt my server and installed node and scraper (0.0.8) from scratch

from node-scraper.

mape avatar mape commented on July 19, 2024

Hmm I can not reproduce that error.

from node-scraper.

abhinavxrai avatar abhinavxrai commented on July 19, 2024

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.

abhinavxrai avatar abhinavxrai commented on July 19, 2024

I'm running
[email protected]
[email protected]

What versions are you running?

from node-scraper.

mape avatar mape commented on July 19, 2024

node v0.4.1
npm 0.3.9

from node-scraper.

abhinavxrai avatar abhinavxrai commented on July 19, 2024

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.

DenisMir avatar DenisMir commented on July 19, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.