Skip to content
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

DynamicScraper from the example not doing anything #57

Open
jeremythille opened this issue Mar 7, 2016 · 6 comments
Open

DynamicScraper from the example not doing anything #57

jeremythille opened this issue Mar 7, 2016 · 6 comments

Comments

@jeremythille
Copy link

I'm trying out the examples exactly as written. The HackerNews example with scraperjs.StaticScraper works perfectly fine and I get a big array of strings.

However, replacing Static with Dynamic doesn't do anything. At all. The execution just ends with no error. I tried debugging it, adding try/catch statements, but I still get no error.
I tried "npm install phantom" too, but it doesn't change anything for scraperjs.
I have no idea what's wrong here.

@abinashmeher999
Copy link

+1

@skibish
Copy link

skibish commented Mar 27, 2016

@jeremythille @abinashmeher999 It will work, if you downgrade phatomjs to 1.9.8 version as mentioned in #53

@QuentinRoy
Copy link

I downgraded to phantomjs 1.9.8 but it still does not work on Mac OS 10.11.5.

@Nosion
Copy link

Nosion commented Jun 11, 2016

Removing the folder node_modules and install again did the trick for me.

@brennanerbezniksc
Copy link

Downgraded to 1.9.8 and no luck

@coopernurse
Copy link

coopernurse commented Apr 29, 2017

Check your version of node. It looks like DynamicScraper doesn't work with newer node versions. node 7.9 didn't work for me, but 4.8.2 worked fine.

I'm building a docker image to encapsulate the correct version of node/phantom/scraperjs, as it appears there's a pretty specific set of versions that are required to make this all work.

This Dockerfile worked for me:

FROM node:4.8

WORKDIR /scraperjs
RUN npm install scraperjs
RUN npm install -g '[email protected]'
ENV NODE_PATH=/scraperjs/node_modules

then:

# assumes dynamic HN example is in 'hn.js'
$ sudo docker build -t coopernurse/scraperjs .
$ sudo docker run --rm -v `pwd`:/code coopernurse/scraperjs node /code/hn.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants