我跟着document
但仍然无法抓取多个页面。你知道吗
我的代码是这样的:
def parse(self, response):
for thing in response.xpath('//article'):
item = MyItem()
request = scrapy.Request(link,
callback=self.parse_detail)
request.meta['item'] = item
yield request
def parse_detail(self, response):
print "here\n"
item = response.meta['item']
item['test'] = "test"
yield item
运行此代码不会调用parse\u detail函数,也不会对任何数据进行爬网。你知道吗?谢谢!你知道吗
我发现如果我把允许的域注释掉,它就会起作用。但这毫无意义,因为链接肯定属于允许的域。你知道吗
相关问题 更多 >
编程相关推荐