在用 PySpider 爬取 https 开头的网站的时候遇到了 HTTP 599: SSL certificate problem: self signed certificate in certificate chain 的错误。

经过一番排查,解决方案总结如下

错误原因

这个错误会发生在请求 https 开头的网址,SSL 验证错误,证书有误。

报错如下:

[E 180823 09:18:21 base_handler:203] HTTP 599: SSL certificate problem: self signed certificate in certificate chain
Traceback (most recent call last):
File "f:\python\python36\lib\site-packages\pyspider\libs\base_handler.py", line 196, in run_task
result = self._run_task(task, response)
File "f:\python\python36\lib\site-packages\pyspider\libs\base_handler.py", line 175, in _run_task
response.raise_for_status()
File "f:\python\python36\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 "f:\python\python36\lib\site-packages\six.py", line 692, in reraise
raise value.with_traceback(tb)
File "f:\python\python36\lib\site-packages\pyspider\fetcher\tornado_fetcher.py", line 378, in http_fetch
response = yield gen.maybe_future(self.http_client.fetch(request))
File "f:\python\python36\lib\site-packages\tornado\httpclient.py", line 102, in fetch
self._async_client.fetch, request, **kwargs))
File "f:\python\python36\lib\site-packages\tornado\ioloop.py", line 458, in run_sync
return future_cell[0].result()
File "f:\python\python36\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: self signed certificate in certificate chain

最简单的解决方法是:

在 crawl 方法中加入忽略证书验证的参数,validate_cert=False,即

 
 
1
self.crawl(url,callback=method_name,validate_cert=False)

PySpider HTTP 599: SSL certificate problem错误的解决方法的更多相关文章

  1. PySpider HTTP 599: SSL certificate problem错误的解决方法(转)

    前言 最近发现许多小伙伴在用 PySpider 爬取 https 开头的网站的时候遇到了 HTTP 599: SSL certificate problem: self signed certific ...

  2. PySpider 框架爬虫错误 HTTP 599: SSL certificate problem: unable to get local issuer certificate解决方案

    首先pyspider all启动pyspider的所有服务,然后访问http://localhost:5000创建一个爬虫任务:taobaomm,点开任务链接编辑http://localhost:50 ...

  3. HTTP 599: SSL certificate problem: unable to get local issuer certificate错误

    自己在用 PySpider 框架爬虫运行代码后时出现 HTTP 599: SSL certificate problem: unable to get local issuer certificate ...

  4. Git发生SSL certificate problem: certificate ha错误的解决方法

    这两天,不知道为什么,用Git提交代码到服务器时,总出现SSL certificate problem: unable to get local issuer certificate while ac ...

  5. Exception: HTTP 599: SSL certificate problem: unable to get local issuer certificate 解决办法

    使用Pyspider中报此错误. 错误原因: 这个错误会发生在请求 https 开头的网址,SSL 验证错误,证书有误. 解决方法: 使用self.crawl(url, callback=self.i ...

  6. Git发生SSL certificate problem: certificate ha错误

    这两天,不知道为什么,用Git提交代码到服务器时,总出现SSL certificate problem: unable to get local issuer certificate while ac ...

  7. curl: (60) SSL certificate problem: unable to get local issuer certificate 错误

    今天同事做微信管理的项目,请求接口返回如下错误SSL certificate problem: unable to get local issuer certificate. 此问题的出现是由于没有配 ...

  8. git中的SSL certificate problem: unable to get local issuer certificate错误的解决办法

    我们在使用git初始化一个项目时,尤其是通过git submodule update --init --remote初始化子模块时,可能会遇到下面这个错误: fatal: unable to acce ...

  9. Git错误:unable to access 'https://git.voicegu.com/qa/qa.git/': SSL certificate problem: unable to get local issuer certificate

    fatal: unable to access 'https://git.voicegu.com/qa/qa.git/': SSL certificate problem: unable to get ...

随机推荐

  1. C# .aspx 页面更换命名空间

    1.选中命名空间,右键单击,选择重构,之后选择重命名.如下图: 2.弹出重命名对话框 3.重写你需要的名字,点击确定. 4.这里重点注意了,不可直接点击应用,否则你会后悔的.你必须对应的看看那个是否是 ...

  2. 非常完善的Log4net详细说明(转)

    最可能来源:https://blog.csdn.net/ydm19891101/article/details/50561638 其它转载者:http://www.cnblogs.com/zhangc ...

  3. HTML--SVG基础

    一 SVG概述 SVG是Scalable Vector Graphics的缩写,即缩放式矢量图形; 优点: 1.使用编辑器即可编辑图形; 2.基于XML,SVG图形可以被很容易的搜索,脚本化和压缩; ...

  4. ImmediateFunc.js

    (function(){ var days = ['Sun','Mon','Tue','Wed','Thu','Fri','Sat'] var today = new Date() var msg = ...

  5. Python 字符串的操作

    字符串的拼接 a = "hello" b = "klvchen" c = a + b print(c) 结果: helloklvchen 注意:该方法效率比较低 ...

  6. JS校验身份证号的合法性

    前端表单中有身份证号的校验,下边是用JS来校验身份证号的合法性. 中国居民身份证号码编码规则 第一.二位表示省(自治区.直辖市.特别行政区). 第三.四位表示市(地级市.自治州.盟及国家直辖市所属市辖 ...

  7. 洛谷P1742 最小圆覆盖(计算几何)

    题意 题目链接 Sol 暴力做法是\(O(n^3)\)枚举三个点然后check一下是否能包含所有点 考虑一种随机算法,首先把序列random_shuffle一下. 然后我们枚举一个点\(i\),并维护 ...

  8. element-ui Carousel 走马灯源码分析整理笔记(十一)

    Carousel 走马灯源码分析整理笔记,这篇写的不详细,后面有空补充 main.vue <template> <!--走马灯的最外层包裹div--> <div clas ...

  9. odoo10源码win系统开发环境安装图文教程

    前言 odoo10的源码安装教程不太完整或对新手不够友好,本新手再次整合出一份友好的新手教程(老鸟慎入) 准备工作 一个干净的window系统(事先没有其他python环境的系统)如果怕系统污染可以先 ...

  10. Python中应用虚拟环境

    安装pip sudo apt-get install python3-dev sudo apt install python3-pip 安装virtualenv工具 sudo apt-get inst ...