requests.exceptions.ConnectionError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response',))
时间: 2023-08-20 07:07:52 浏览: 362
引用\[1\]中的错误信息是requests.exceptions.ConnectionError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response',))。这个错误通常是由于请求被远程服务器关闭而导致的连接中断引起的。引用\[2\]中提到了一种解决方法,即使用try-except语句来捕获ConnectionError异常,并在异常处理中设置一个自定义的错误状态码。另外,引用\[3\]中也提到了一些解决方法,如延迟一段时间后再发送请求,或者使用User-Agent头部来模拟浏览器请求。另外,还可以尝试在请求中添加Connection头部并设置为'close'来解决该问题。这些方法都可以尝试一下,具体的解决方法可能因情况而异。
#### 引用[.reference_title]
- *1* *2* [python爬虫 关于requests.exceptions.ConnectionError 等问题](https://blog.csdn.net/wancongconga/article/details/111030335)[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^v91^control,239^v3^insert_chatgpt"}} ] [.reference_item]
- *3* [【错误记录/python】requests库get请求:Remote end closed connection without response](https://blog.csdn.net/qq_33446100/article/details/118113121)[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^v91^control,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文