request可以请求,但是在scrapy里面却出现HTTP status code is not handled or not allowed 404怎么回事
爬取甘肃的网站http://gxt.gansu.gov.cn/zhengfuxinxigongkai/wenjianzhengce/weineiwenjian/Default_36.htm。
用requests可以请求到数据。但是在scrapy里面却出现404HTTP status code is not handled or not allowed,根据论坛的几种解决方法:
1. 更改请求样式request=scrapy.FormRequest(url=url,callback=self.parse_items)变成request=scrapy.http.Request(url=url,callback=self.parse_items)
2. 在setting里面增加404的指令
都不行?有大神能帮忙解决一下吗