MCPcopy
hub / github.com/scrapy/scrapy / _crawl

Method _crawl

scrapy/crawler.py:586–596  ·  view source on GitHub ↗
(self, crawler: Crawler, *args: Any, **kwargs: Any)

Source from the content-addressed store, hash-verified

584 self.bootstrap_failed |= not getattr(crawler, "spider", None)
585
586 def _crawl(self, crawler: Crawler, *args: Any, **kwargs: Any) -> asyncio.Task[None]:
587 # At this point the asyncio loop has been installed either by the user
588 # or by AsyncCrawlerProcess (but it isn't running yet, so no asyncio.create_task()).
589 loop = asyncio.get_event_loop()
590 self.crawlers.add(crawler)
591
592 task = loop.create_task(self._crawl_and_track(crawler, *args, **kwargs))
593 self._active.add(task)
594 task.add_done_callback(partial(self._done, crawler=crawler))
595
596 return task
597
598 async def stop(self) -> None:
599 """

Callers 1

crawlMethod · 0.95

Calls 1

_crawl_and_trackMethod · 0.95

Tested by

no test coverage detected