Remote end closed connection without response

1

raise RemoteDisconnected("Remote end closed connection without"
http.client.RemoteDisconnected: Remote end closed connection without response

 

爬虫报错,待解决

 

已解决,是请求头被网站限制,多弄几个请求头就可以

 2

self._output(request.encode('ascii'))

解决:路径有中文

3

with open(toPath, "w") as f:
FileNotFoundError: [Errno 2] No such file or directory

#解决

记住写入时要字符串格式,还有就是路径前面要加r

猜你喜欢

转载自www.cnblogs.com/zlong123/p/10525908.html