PySpider Problem Record http599

Posted by konigwolf on Mon, 07 Oct 2019 03:45:54 +0200

Links to the original text: http://www.cnblogs.com/sky_Great/p/7643036.html

Brief description of problems

Background note:

python version 3.5.2

Operational procedures:

  • 1. Perform pyspider installation:
  •   pip install pyspider
  • 2. Running pyspider
  •   pyspider all
  • 3. Open the browser for task configuration
  •   localhost:5000
  • 4. Add and execute task s

The error is described below.

    [E 171009 20:37:58 base_handler:203] HTTP 599: SSL certificate problem: unable to get local issuer certificate
Traceback (most recent call last):
  File "d:\python\python35\lib\site-packages\pyspider\libs\base_handler.py", line 196, in run_task
    result = self._run_task(task, response)
  File "d:\python\python35\lib\site-packages\pyspider\libs\base_handler.py", line 175, in _run_task
    response.raise_for_status()
  File "d:\python\python35\lib\site-packages\pyspider\libs\response.py", line 172, in raise_for_status
    six.reraise(Exception, Exception(self.error), Traceback.from_string(self.traceback).as_traceback())
  File "d:\python\python35\lib\site-packages\six.py", line 692, in reraise
    raise value.with_traceback(tb)
  File "d:\python\python35\lib\site-packages\pyspider\fetcher\tornado_fetcher.py", line 378, in http_fetch
    response = yield gen.maybe_future(self.http_client.fetch(request))
  File "d:\python\python35\lib\site-packages\tornado\httpclient.py", line 102, in fetch
    self._async_client.fetch, request, **kwargs))
  File "d:\python\python35\lib\site-packages\tornado\ioloop.py", line 458, in run_sync
    return future_cell[0].result()
  File "d:\python\python35\lib\site-packages\tornado\concurrent.py", line 238, in result
    raise_exc_info(self._exc_info)
  File "<string>", line 4, in raise_exc_info
Exception: HTTP 599: SSL certificate problem: unable to get local issuer certificate

Exclusion process

  • 1. Updating pyspider (using the latest version) still has this problem
  • 2. There are still problems with using the code validate_cert= false.
  •               self.crawl(it.href, validate_cert = False)

Then check the error message carefully:

    File "d:\python\python35\lib\site-packages\tornado\concurrent.py", line 238, in result
    raise_exc_info(self._exc_info)

After searching: https://laracasts.com/discuss/channels/general-discussion/curl-error-60-ssl-certificate-problem-unable-to-get-local-issuer-certificate/replies/37017

A similar scenario is described:

  1. download http://curl.haxx.se/ca/cacert.pem
  2. Error the file into the above directory: d: python python35 lib site-packages Tornado
  3. Problem solving.

Reprinted at: https://www.cnblogs.com/sky_Great/p/7643036.html

Topics: Python SSL curl pip