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

crawl with phantomjs return 501 #432

Closed
le1boy opened this issue Apr 21, 2016 · 2 comments
Closed

crawl with phantomjs return 501 #432

le1boy opened this issue Apr 21, 2016 · 2 comments

Comments

@le1boy
Copy link

le1boy commented Apr 21, 2016

I installed pyspider on my ubuntu with the deployment guide http://docs.pyspider.org/en/latest/Deployment/. When I set fetch_type = js to render web with phantomjs. It gave me the 501 error.

Traceback (most recent call last):
      File "/usr/local/lib/python2.7/dist-packages/pyspider/libs/base_handler.py", line 188, in run_task
        result = self._run_task(task, response)
      File "/usr/local/lib/python2.7/dist-packages/pyspider/libs/base_handler.py", line 167, in _run_task
        response.raise_for_status()
      File "/usr/local/lib/python2.7/dist-packages/pyspider/libs/response.py", line 190, in raise_for_status
        raise http_error
    HTTPError: 501 Server Error

I can find the log "Web server running on port 25555" when I start the pyspider. This is my shell code and it came from the deoloyment guide.

# start **only one** scheduler instance
pyspider -c config.json scheduler

# phantomjs
pyspider -c config.json phantomjs

# start fetcher / processor / result_worker instances as many as your needs
pyspider -c config.json --phantomjs-proxy="localhost:25555" fetcher
pyspider -c config.json processor
pyspider -c config.json result_worker

# start webui, set `--scheduler-rpc` if scheduler is not running on the same host as webui
pyspider -c config.json webui

But if I just run command pyspider, it works fine with phantomjs. I tried to figure it out, but appearently I failed. The version of pyspider is 0.3.6 and phantomjs is 2.1.1.

@binux
Copy link
Owner

binux commented Apr 21, 2016

give the --phantomjs-proxy="localhost:25555" argument to webui

@le1boy
Copy link
Author

le1boy commented Apr 22, 2016

Thanks, it woks.

@binux binux closed this as completed May 3, 2016
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

2 participants