在GitHub上可用的最新版本的Scrapy中,你可以引发CloseSpider异常以手动关闭蜘蛛。
在0.14版本说明文档中提到了文档:“添加了CloseSpider异常以手动关闭蜘蛛(r2691)”
根据文档的示例:
def parse_page(self, response): if 'Bandwidth exceeded' in response.body: raise CloseSpider('bandwidth_exceeded')
在GitHub上可用的最新版本的Scrapy中,你可以引发CloseSpider异常以手动关闭蜘蛛。
在0.14版本说明文档中提到了文档:“添加了CloseSpider异常以手动关闭蜘蛛(r2691)”
根据文档的示例:
def parse_page(self, response): if 'Bandwidth exceeded' in response.body: raise CloseSpider('bandwidth_exceeded')