GithubHelp home page GithubHelp logo

Comments (15)

mape avatar mape commented on July 19, 2024

Have you tried it with latest stable?

from node-scraper.

gerad avatar gerad commented on July 19, 2024

Yeah, fails on node 0.4.2 with jsdom 0.2.0... works fine with jsdom 0.1.23.

from node-scraper.

mape avatar mape commented on July 19, 2024

Is that when using the examples or scraping a different site?

from node-scraper.

gerad avatar gerad commented on July 19, 2024

Just the first simple twitter example in your README.

from node-scraper.

gerad avatar gerad commented on July 19, 2024

Seems like it's probably a JSDOM issue.

from node-scraper.

mape avatar mape commented on July 19, 2024

I don't have that issue though, but yeah, seems jsdom doesn't want to play.

from node-scraper.

jpiulac avatar jpiulac commented on July 19, 2024

Had the same issue. fixed with change to scraper.js

replaced __dirname+'/../deps/jquery-1.3.2.js'
with 'http://code.jquery.com/jquery-1.4.2.min.js'

seems to be an issue loading the file in jsdom.jQuerify call - path is correct and permissions are fine so not sure what the problem is.

from node-scraper.

EvanCarroll avatar EvanCarroll commented on July 19, 2024

This issue isn't solved. I had the same problem with jsdom 0.2.0 , and I solved it with @jma3s suggestion.

$ node --version
v0.4.7

I actually upgrade though to jquery-1.6.0

from node-scraper.

sindresorhus avatar sindresorhus commented on July 19, 2024

Tried @jma3s fix, but still get that error.

TypeError: Cannot read property 'prototype' of undefined
    at /Users/mofle/node_modules/scraper/node_modules/jsdom/lib/jsdom/browser/index.js:84:16
    at String.<anonymous> ([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 (/Users/mofle/node_modules/scraper/node_modules/jsdom/lib/jsdom/level2/languages/javascript.js:17:14)
    at Object._eval (/Users/mofle/node_modules/scraper/node_modules/jsdom/lib/jsdom/level2/html.js:1195:46)
    at /Users/mofle/node_modules/scraper/node_modules/jsdom/lib/jsdom/level2/html.js:43:20
    at Object.check (/Users/mofle/node_modules/scraper/node_modules/jsdom/lib/jsdom/level2/html.js:235:11)
    at /Users/mofle/node_modules/scraper/node_modules/jsdom/lib/jsdom/level2/html.js:251:12
    at [object Object].<anonymous> (fs.js:107:5)
    at [object Object].emit (events.js:61:17)
    at afterRead (fs.js:878:12)
    at wrapper (fs.js:245:17)
TypeError: undefined is not a function
    at CALL_NON_FUNCTION (native)
    at /Users/mofle/node_modules/scraper/lib/scraper.js:58:7
    at /Users/mofle/node_modules/scraper/node_modules/jsdom/lib/jsdom.js:151:7
    at Object.<anonymous> (/Users/mofle/node_modules/scraper/node_modules/jsdom/lib/jsdom/level2/events.js:274:17)
    at Object.dispatchEvent (/Users/mofle/node_modules/scraper/node_modules/jsdom/lib/jsdom/level2/html.js:415:55)
    at /Users/mofle/node_modules/scraper/node_modules/jsdom/lib/jsdom/level2/html.js:56:15
    at Object.check (/Users/mofle/node_modules/scraper/node_modules/jsdom/lib/jsdom/level2/html.js:235:11)
    at /Users/mofle/node_modules/scraper/node_modules/jsdom/lib/jsdom/level2/html.js:251:12
    at [object Object].<anonymous> (fs.js:107:5)
    at [object Object].emit (events.js:61:17)

from node-scraper.

dkordik avatar dkordik commented on July 19, 2024

Mine was fixed by updating jQuery ala @jma3s. I used 1.6.1.

from node-scraper.

EvanCarroll avatar EvanCarroll commented on July 19, 2024

@mape could we get this patched with @jma3s's suggestion and the latest version of jQuery?

from node-scraper.

mape avatar mape commented on July 19, 2024

The scraper is now updated to use jQuery 1.6.1 and is pushed to npm.

@mofle Do you get that error with all pages? And are you using latest jsdom?

from node-scraper.

muloka avatar muloka commented on July 19, 2024

There is also an issue with jsdom 0.2.0 which has been fixed in 0.2.1 though it has not been yet pushed to npm. Also line 57 of scrape.js is still referring to jQuery 1.3.2.

After switching it to the supplied 1.6.1 library and changing the require statement to point to [email protected], scraper is working as expected.

p.s.: I'm currently using node v0.5.0-pre.

from node-scraper.

mape avatar mape commented on July 19, 2024

Silly me, pushed update that uses jQuery 1.61.

from node-scraper.

EyePulp avatar EyePulp commented on July 19, 2024

I did a manual uninstall of jsdom via npm: npm uninstall jsdom from within the scraper directory project/node_modules/scraper

and then ran this:
npm install https://github.com/tmpvar/jsdom/tarball/4cf155a1624b3fb54b2eec536a0c060ec1bab4ab
out at the upper level project/ - it seems to have fixed it also. (it has the jsdom 0.2.1 fix)

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.