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 ...
随机推荐
- Spark集群的任务提交执行流程
本文转自:https://www.linuxidc.com/Linux/2018-02/150886.htm 一.Spark on Standalone 1.spark集群启动后,Worker向Mas ...
- eclipse中安装windowbuilder插件、应用及卸载
一.安装windowbuilder插件 1.找到对应版本的windowbuilder 连接地址:http://www.eclipse.org/windowbuilder/download.php 如图 ...
- 【RabbitMQ】2、心得总结,资料汇总
Spring AMQP中文文档 http://ju.outofmemory.cn/entry/320538 云栖社区 https://yq.aliyun.com/search?q=rabbitm ...
- 秒懂AOP
AOP(Aspect Orient Programming),作为面向对象编程的一种补充,广泛应用于处理一些具有横切性质的系统级服务,如事务管理.安全检查.缓存.对象池管理等.AOP 实现的关键就在于 ...
- 【代码笔记】Web-ionic-创建APP的架构
一,创建app的时候,index.html的主要架构. <!DOCTYPE html> <html> <head> <meta charset="u ...
- 简单实用的jQuery分页插件
在做商城和订单管理的时候,常常会用到分页功能,所以我封装了一个jQuery的分页插件,该插件主要实现上下翻页,输入数字跳转等功能. 具体实现如下: 输入参数需要当前页码pageNo,总页码totalP ...
- Salesforce 数据库操作简介
Salesforce 中的数据库操作方式 Salesforce 为用户和开发者提供了四种基本的数据库操作方式: Apex 中的 DML 语句 Apex 中的 Database 类 SOQL 查询 SO ...
- 测试思想-测试设计 史上最详细测试用例设计实践总结 Part2
史上最详细测试用例设计实践总结 by:授客 QQ:1033553122 -------------------------接 Part1-------------------------- 方法:这里 ...
- spring使用BeanPostProcesor实现AOP源码分析
源码 AbstractApplicationContext#public void refresh() throws BeansException, IllegalStateException { f ...
- (网页)js最新手机号码、电话号码正则表达式
正则表达式(regular expression)是一个描述字符模式的对象.使用JavaScript正则表达式可以进行强大的模式匹配和文本检索与替换功能. 手机号码正则表达式验证. function ...