PySpider问题记录http599

问题简述

背景说明:

python版本 3.5.2

操作流程

  • 1.执行pyspider安装:
  •   pip install pyspider
    
  • 2.运行pyspider
  •   pyspider all
    
  • 3.打开浏览器进行任务配置
  •   localhost:5000
    
  • 4.新增并执行task

错误如下描述

    [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

排除过程

  • 1.更新pyspider(使用最新版本),仍存在该问题
  • 2.使用代码 validate_cert =false 仍存在给问题;
  •               self.crawl(it.href, validate_cert = False)
    

后仔细查看报错信息:

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

后搜索得之:https://laracasts.com/discuss/channels/general-discussion/curl-error-60-ssl-certificate-problem-unable-to-get-local-issuer-certificate/replies/37017

讲述了类似的场景:

  1. 下载 http://curl.haxx.se/ca/cacert.pem
  2. 将文件报错到上述目录:d:\python\python35\lib\site-packages\tornado\
  3. 问题解决。
posted @ 2017-10-09 21:13  Devin Mao  阅读(1051)  评论(0编辑  收藏  举报