PySpider HTTP 599: SSL certificate problem错误的解决方法
在用 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错误的解决方法的更多相关文章
- PySpider HTTP 599: SSL certificate problem错误的解决方法(转)
前言 最近发现许多小伙伴在用 PySpider 爬取 https 开头的网站的时候遇到了 HTTP 599: SSL certificate problem: self signed certific ...
- PySpider 框架爬虫错误 HTTP 599: SSL certificate problem: unable to get local issuer certificate解决方案
首先pyspider all启动pyspider的所有服务,然后访问http://localhost:5000创建一个爬虫任务:taobaomm,点开任务链接编辑http://localhost:50 ...
- HTTP 599: SSL certificate problem: unable to get local issuer certificate错误
自己在用 PySpider 框架爬虫运行代码后时出现 HTTP 599: SSL certificate problem: unable to get local issuer certificate ...
- Git发生SSL certificate problem: certificate ha错误的解决方法
这两天,不知道为什么,用Git提交代码到服务器时,总出现SSL certificate problem: unable to get local issuer certificate while ac ...
- Exception: HTTP 599: SSL certificate problem: unable to get local issuer certificate 解决办法
使用Pyspider中报此错误. 错误原因: 这个错误会发生在请求 https 开头的网址,SSL 验证错误,证书有误. 解决方法: 使用self.crawl(url, callback=self.i ...
- Git发生SSL certificate problem: certificate ha错误
这两天,不知道为什么,用Git提交代码到服务器时,总出现SSL certificate problem: unable to get local issuer certificate while ac ...
- curl: (60) SSL certificate problem: unable to get local issuer certificate 错误
今天同事做微信管理的项目,请求接口返回如下错误SSL certificate problem: unable to get local issuer certificate. 此问题的出现是由于没有配 ...
- git中的SSL certificate problem: unable to get local issuer certificate错误的解决办法
我们在使用git初始化一个项目时,尤其是通过git submodule update --init --remote初始化子模块时,可能会遇到下面这个错误: fatal: unable to acce ...
- 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 ...
随机推荐
- c# 数组协变
class a{} class b:a{} a[] arr=new a[3]; a[] arr2=new a[3]; 给arr 数组赋值 arr[0]=new a(); arr2[0]=new b() ...
- Java并发编程:什么是CAS?这回总算知道了
无锁的思想 众所周知,Java中对并发控制的最常见方法就是锁,锁能保证同一时刻只能有一个线程访问临界区的资源,从而实现线程安全.然而,锁虽然有效,但采用的是一种悲观的策略.它假设每一次对临界区资源的访 ...
- 【Java基础】2、Java中普通代码块,构造代码块,静态代码块区别及代码示例
Java中普通代码块,构造代码块,静态代码块区别及代码示例.Java中普通代码块,构造代码块,静态代码块区别及代码示例 执行顺序:静态代码块>静态方法(main方法)>构造代码块>构 ...
- NIO学习笔记四 :SocketChannel 和 ServerSocketChannel
Java NIO中的SocketChannel是一个连接到TCP网络套接字的通道.可以通过以下2种方式创建SocketChannel: 打开一个SocketChannel并连接到互联网上的某台服务器. ...
- Python知识点小记
类 设置类属性必须使用类对象,若使用实例对象设置,会重新创建一个和类属性同名的实例属性 类对象可调用 类方法&静态方法, 实例对象可调用 实例方法&类方法&静态方法; 类方法和 ...
- idea not found for the web module
intellij IDEA 的tomcat 配置项里面没有的app web:war exploded 没有配置/路径
- 自定义基于jquery竖向瀑布流插件
公司新项目做了一个关于图片的板块,网上找了一些瀑布流插件都不是很适合自己,于是就自己造轮子写一个,并封装成插件github 于是就想分享一下,主要是为了更好的学习与记忆. 如果大家进来了,希望能给我g ...
- python 通过 pip 更新所有已安装的包
较新的 pip 已经支持 list --outdated 了,所以记录一下新的方法: pip list --outdated --format=legacy |awk '{print $1}' |xa ...
- Python3选择支持非ASCII码标识符的缘由
原文在: PEP 3131 -- Supporting Non-ASCII Identifiers. Python2并不支持非ASCII码标识符. PEP的全称是Python Enhancement ...
- 排错-Loadrunner添加Windows Resource计数器提示“找不到网络路径”解决方法
Loadrunner添加Windows Resource计数器提示“找不到网络路径”解决方法 by:授客 QQ:1033553122 1.启动windows相关服务 win->services. ...