scrapy 爬虫时报错:
<twisted.python.failure.Failure twisted.internet.error.ConnectionLost: Connection to the other side was lost in a non-clean fashion: Connection lost.>
<twisted.python.failure.failure twisted.internet.error.connection lost:与另一端的连接以非干净方式丢失:连接丢失。>
查看url,我爬维基百科的时候,使用的url是start_url = “http://en.wikipedia.org/wiki/Outline_of_war”,一直报错,其他的各种浏览器数据都加了,包括浏览器头部等,都报上面那种错误,后来发现,再http里面没有设置升级http协议的字段,让它支持https。
怕麻烦的,直接start_url = “https://en.wikipedia.org/wiki/Outline_of_war”
不怕麻烦的,可以再请求头部设置字段,升级到https协议。