MCPcopy
hub / github.com/scrapy/scrapy / from_crawler

Method from_crawler

scrapy/spiders/sitemap.py:37–45  ·  view source on GitHub ↗
(cls, crawler: Crawler, *args: Any, **kwargs: Any)

Source from the content-addressed store, hash-verified

35
36 @classmethod
37 def from_crawler(cls, crawler: Crawler, *args: Any, **kwargs: Any) -> Self:
38 spider = super().from_crawler(crawler, *args, **kwargs)
39 spider._max_size = getattr(
40 spider, "download_maxsize", spider.settings.getint("DOWNLOAD_MAXSIZE")
41 )
42 spider._warn_size = getattr(
43 spider, "download_warnsize", spider.settings.getint("DOWNLOAD_WARNSIZE")
44 )
45 return spider
46
47 def __init__(self, *a: Any, **kw: Any):
48 super().__init__(*a, **kw)

Callers

nothing calls this directly

Calls 1

getintMethod · 0.80

Tested by

no test coverage detected