Requests 之Max retries exceeded with url[Errno 10054]错误新解
来源:互联网 发布:广东软件行业协会 招聘 编辑:程序博客网 时间:2024/06/02 05:27
只要使用过requests模块,想必对Max retries exceeded with url[Errno 10054]
错误都不会太陌生。
这是requests常见的一种错误,原因就是连接太多没有关闭导致socket超时。
一般的解读是urllib3的问题,因为requests是基于urllib3的,urllib3默认不支持长连接即keep-alive
解决方案一
requests.adapters.DEFAULT_RETRIES = 5
解决方案二
s = requests.session()s.keep_alive = False
新的情况
我的小爬虫其实只爬了一个页面就出现这个错误,而且并没有进行并发,也不会被封,而且几分钟前运行还正常。
经过排查发现,刚开了迅雷下载了很多文件,关了迅雷之后一切正常。
典型的多连接问题,当时出现错误的时候真的一脸蒙圈
阅读全文
1 0
- Requests 之Max retries exceeded with url[Errno 10054]错误新解
- Max retries exceeded with url 错误
- Python requests“Max retries exceeded with url” error
- Max retries exceeded with url
- python 爬虫‘Max retries exceeded with url’错误
- Max retries exceeded with url Error
- Python爬取知乎回答信息碰到:Max retries exceeded with URL
- Max retries exceeded with ur
- 数据处理后的缓存清除问题:Max retries exceeded with url
- 错误: Max depth exceeded when dereferencing c0-e1.
- OGG-01224 TCP/IP error 111 (Connection refused); retries exceeded.
- python3爬虫requests.get(url)出现http 500错误
- ERRNO错误
- max no of gateways exceeded
- requests.exceptions.TooManyRedirects: Exceeded 30 redirects.
- errno, strerror (errno)) 错误打印
- requests.post(url, da)
- SpringMVC错误之No mapping found for HTTP request with [url]
- 使用selenium操作PhantomJS的常用操作
- C#索引器
- Leetcode-Pascal's triangle
- 傅里叶变换直观解释
- pwnable.tw之hacknote
- Requests 之Max retries exceeded with url[Errno 10054]错误新解
- SSH连接Ubuntu虚拟机失败
- 使用phantomjs访问网站,高度自定义headers
- JavaScript --Map和Set, Iterable
- 【STL】map要点及使用
- 实验三之顺序队列的实现
- Excel数据导出到txt文档
- SortList
- 实验二 线性表综合实验之《间接寻址》