Connection was refused by other side: 111: Connection refused. scrapy设置随机代理的步骤

报错1:Connection was refused by other side: 111: Connection refused.
报错2:Got data loss in https://www.amazon.cn/. If you want to process broken responses set the setting DOWNLOAD_FAIL_ON_DATALOSS = False – This message won’t be shown in further requests
(failed 1 times): [<twisted.python.failure.Failure twisted.internet.error.ConnectionLost: Connection to the other side was lost in a non-clean fashion: Connection lost.>

这2者都共同指向一个问题:就是连接丢失或被拒绝。

原因:共同点:都是因为代理或请求头问题而无法连接服务器(我的是因为代理)
不同点:报错1,IP已经过期,可能被识别出是爬虫了,被亚马逊服务器拒绝访问。报错2:我的IP写错了,检查一下去,果然漏了http。

解决办法:报错2:检查IP要写对。
proxy_list = {
‘http’:[‘http://112.85.130.212:9999’],
‘https’:[‘https://112.85.131.114:9999’,‘https://112.87.71.128:9999’,‘https://112.87.68.118:9999’]
}

报错1:给proxy_list更换新的IP。

报错:Could not open CONNECT tunnel with proxy xxx 也是IP无法使用的表现(我用的是透明IP去访问就给我报这样的错)
对于免费的IP确实可用率只有个位数,以后建议花钱到九州等IP网站去获取大量高价值的可用iP,听说响应速度还更快。

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值