pyspider框架的599证书问题

使用PySpider 框架出现错误 HTTP 599: SSL certificate problem: unable to get local issuer certificate,如下

HTTP 599: SSL certificate problem: unable to get local issuer certificate 
[E 161018 21:56:36 base_handler:195] HTTP 599: SSL certificate problem: unable to get local issuer certificate 
Traceback (most recent call last): 
File “C:\Python27\lib\site-packages\pyspider\libs\base_handler.py”, line 188, in run_task 
result = self._run_task(task, response) 
File “C:\Python27\lib\site-packages\pyspider\libs\base_handler.py”, line 167, in _run_task 
response.raise_for_status() 
File “C:\Python27\lib\site-packages\pyspider\libs\response.py”, line 190, in raise_for_status 
raise http_error 
HTTPError: HTTP 599: SSL certificate problem: unable to get local issuer certificate

原因:

因为https协议需要对证书进行验证导致,对访问https网络需要证书

解决方法:

在两个抓取函数中 加入 不要检验证书: 

validate_cert=False

 

成功解决!

猜你喜欢

转载自www.cnblogs.com/liangmingshen/p/10240210.html