用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。
重新啟動 小蜘蛛 沒問題了 但實際問題仍沒解決