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


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM