Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想知道是否可以在同一个项目中同时使用多个蜘蛛。其实我需要2只蜘蛛。第一个收集第二个蜘蛛应该抓取的链接。他们都在同一个网站上工作,所以域是相似的。有可能吗?如果是,你能给我一个例子吗?谢谢
也许这就是你要找的:
def parse(self, response): # parse the links (aka your first spider) for link in hxs('//XPATH'): yield Request(link.extract(), callback=self.parse_link) def parse_link(self, response): # continue parsing (aka your second spider)
希望这对你有帮助:)