Connection aborted. , ConnectionResetError(104, Connection reset by peer )
时间: 2023-10-13 15:04:11 浏览: 1565
connection reset by peer问题总结及解决方案
5星 · 资源好评率100%
Connection aborted. , ConnectionResetError(104, Connection reset by peer)可能是由两个原因引起的。首先,这可能是因为请求过于频繁,导致请求被服务器拒绝。其次,可能是由于连接超时或访问被拒绝的问题引起的。在这种情况下,通常会出现类似的错误信息,如requests.exceptions.ConnectionError: ('Connection aborted.', error(54, 'Connection reset by peer'))或requests.exceptions.ConnectionError: HTTPSConnectionPool(host='***', port=443): Max retries exceeded with url: *** (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x104491cc0>: Failed to establish a new connection: [Errno 60] Operation timed out',))。为了解决这个问题,你可以尝试两种方法:1.减少请求频率,避免过于频繁地发送请求;2.检查目标网站是否有认证或反爬机制,并识别是否拒绝了Python终端的访问。如果是这种情况,你可以尝试设置一个休眠时间,例如time.sleep(1),来减慢请求的速度,以规避反爬机制。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *3* [python requests请求报错ConnectionError: (‘Connection ...‘, error(104, ‘Connection reset by peer‘))](https://blog.csdn.net/weixin_43925447/article/details/123191482)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *2* [python访问目标网站报错(‘Connection aborted.‘, error(54, ‘Connection reset by peer‘))解决方案](https://blog.csdn.net/weixin_42669785/article/details/111085396)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文