Python3.6请求网站时报错:http.client.RemoteDisconnected: Remote end closed connection without response
来源:互联网 发布:用户画像建模算法 编辑:程序博客网 时间:2024/06/06 02:32
调整前的代码段:
data = urllib.request.urlopen(url).read()
运行时报错: http.client.RemoteDisconnected: Remote end closed connection without response
调整后代码段:
headers = {'User-Agent': 'User-Agent:Mozilla/5.0'} data1 = urllib.request.Request(url, headers=headers) data = urllib.request.urlopen(data1).read()
正常运行
原因:服务器限制了部分User-Agent的访问。
阅读全文
0 0
- Python3.6请求网站时报错:http.client.RemoteDisconnected: Remote end closed connection without response
- 爬虫过程报错:http.client.RemoteDisconnected: Remote end closed connection without response
- python爬虫过程报错:http.client.RemoteDisconnected: Remote end closed connection without response
- ssh_exchange_identification: Connection closed by remote
- 监听器启动时报错:TNS-12537: TNS:connection closed/ TNS-00507: Connection closed
- java http 客户端使用TSLv1.2[解决Remote host closed connection during handshake的问题]
- ssh_exchange_identification: Connection closed by remote host
- ssh_exchange_identification: Connection closed by remote host
- ssh_exchange_identification: Connection closed by remote host
- ssh_exchange_identification: Connection closed by remote host
- ssh_exchange_identification: Connection closed by remote host
- ssh_exchange_identification: Connection closed by remote host
- 【转载】 ssh_exchange_identification: Connection closed by remote host
- Qtcpsocket The remote host closed the connection
- ssh_exchange_identification: Connection closed by remote host
- ssh_exchange_identification: Connection closed by remote host
- ssh_exchange_identification: Connection closed by remote hos
- Retrofit请求,返回response时报错
- Kotlin语法(九)
- iFunk翼超极本苏宁易购正式开售啦
- Windows下使用BeautifulSoup 出现You are trying to run the Python 2 version of Beautiful Soup under Python
- 【JMeter】JMeter使用plugins插件进行服务器性能监控
- Java基础——substring字符串截取
- Python3.6请求网站时报错:http.client.RemoteDisconnected: Remote end closed connection without response
- tensorflow CUDA out of memory
- Servlet生命周期、工作原理
- getpwnam,getgrnam,getpwent,crypt等函数
- python 中文乱码问题深入分析
- leetcode 26. Remove Duplicates from Sorted Array
- home键源码分析
- Jquery 点击图片在弹出层显示大图
- JDBC 连接池封装