scrapy 采集网页出现丢失url的问题

url_list = ["http://www.icoat.cc/news/list_18_3.html", "http://www.icoat.cc/news/list_18.html",
"http://www.icoat.cc/news/list_18_2.html",
]
for ls in url_list:
  yield scrapy.Request(url=ls, headers=header, callback=self.parseList, meta={"hd": header})

采集的过程中发现丢失了很多url,而且url_list中只采集了前两个,不知道为什么,google后发现加上dont_filter后可以解决丢失url的问题

yield scrapy.Request(url=ls, headers=header, callback=self.parseList, meta={"hd": header}, dont_filter=True)

posted @ 2019-03-06 11:48  kakaok  阅读(542)  评论(0编辑  收藏  举报