INFO: Ignoring response <503 http://www.xicidaili.com/nn>: HTTP status code is not handled or not allowed 用scrapy爬虫

用scrapy爬取http://www.xicidaili.com/nt/1(国内ip)是启动小蜘蛛一直报错,将网址换成百度是可以进入parse。

错误:

2018-04-17 16:55:52 [scrapy.core.engine] DEBUG: Crawled (503) <GET http://www.xicidaili.com/nn> (referer: None)
2018-04-17 16:55:53 [scrapy.spidermiddlewares.httperror] INFO: Ignoring response <503 http://www.xicidaili.com/nn>: HTTP status code is not handled or not allowed

 

在setting中设置

HTTPERROR_ALLOWED_CODES = [503] #忽略503页面  (不建议使用)
HTTPERROR_ALLOWED_CODES默认: [] 忽略该列表中所有非200状态码的response。 
 
重新启动 小蜘蛛 没问题了 但实际问题仍没解决
posted @ 2018-04-17 17:10  自说自话唉  阅读(4368)  评论(0编辑  收藏  举报