def open_spider(self, spider, start_requests=None, close_if_idle=True): |
print 'engine.open_spider open_spider()' |
assert self.has_capacity(), "No free spider slots when opening %r" % \ |
log.msg("Spider opened", spider=spider) |
nextcall = CallLaterOnce(self._next_request, spider) |
scheduler = self.scheduler_cls.from_settings(self.settings) |
slot = Slot(start_requests or (), close_if_idle, nextcall, scheduler) |
self.slots[spider] = slot |
yield scheduler.open(spider) |
print 'first yield ======' |
yield self.scraper.open_spider(spider) |
print 'second yield ======' |
stats.open_spider(spider) |
yield send_catch_log_deferred(signals.spider_opened, spider=spider) |
print 'third yield ======' |
open_spider(-----)
| 这个时候会执行open_spider()函数体吗 ? |
|