在用 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# 获取本机IP

    /// <summary> /// 获取本机IP /// </summary> /// <returns></returns> public stati ...

  2. c# txt代码转换成HTML格式

    /// <summary> /// 字符串字符处理 /// </summary> /// <param name="chr">等待处理的字符串& ...

  3. U盘基本处理,U盘与移动固态硬盘

    一.辨别 USB2.0 和 USB3.0 1.从USB外观上来看,USB2.0通常是白色或黑色,而USB3.0则改观为“高大上”的蓝色接口. 目前,部分笔记本电脑USB接口,已同时提供对USB2.0及 ...

  4. ip2Long 代码

    def ip2Long(ip: String): Long = { val fragments = ip.split("[.]") var ipNum = 0L for (i &l ...

  5. 【原】Dubbo 多版本号过渡

    之前发过一篇因为接口规范的问题导致其它端出现服务不可用的文章(http://www.cnblogs.com/zdd-java/p/8612763.html),然而最近在查阅了dubbo官方指南文档才知 ...

  6. 【Java基础】3、Java 位运算(移位、位与、或、异或、非)

    public class Test { public static void main(String[] args) { // 1.左移( << ) // 0000 0000 0000 0 ...

  7. 【Spring】4、Spring中 @Autowired标签与 @Resource标签 的区别

    转自:http://blog.csdn.net/angus_17/article/details/7543478 spring不但支持自己定义的@Autowired注解,还支持由JSR-250规范定义 ...

  8. ConcurrentHashMap底层实现原理(JDK1.8)源码分析

    ref:https://blog.csdn.net/xu768840497/article/details/79194701 http://www.cnblogs.com/leesf456/p/545 ...

  9. 【读书笔记】iOS-对iOS应用进行模糊测试

    一,模糊测试,是指通过反复向待测应用发送畸形的数据,对应用进行动态测试的过程. 二,模糊测试,也称动态分析,是一种构造非法输入并将其提供给应用,以期让应用暴露出某些安全问题的艺术和科学. 参考资料:& ...

  10. Python之历史

    一.python简单介绍 python的创始人:吉多·范罗苏姆(Guido van Rossum),于1989年开始编写,到1991年完成了第一个python编译器.它是用C语言实现的,并能够调用C语 ...