标签:指定 spi nal end 信号 sel extend inf int
在指定信号上注册操作
from scrapy import signals class MyExtend: def __init__(self,crawler): self.crawler = crawler # 钩子上挂障碍物 # 在指定信号上注册操作 crawler.signals.connect(self.start, signals.engine_started) crawler.signals.connect(self.close, signals.spider_closed) @classmethod def from_crawler(cls, crawler): return cls(crawler) def start(self): print(‘signals.engine_started.start‘) def close(self): print(‘signals.spider_closed.close‘)
标签:指定 spi nal end 信号 sel extend inf int
原文地址:https://www.cnblogs.com/jintian/p/11438485.html