MCPcopy
hub / github.com/scrapy/scrapy / get_spider_loader

Function get_spider_loader

scrapy/spiderloader.py:25–30  ·  view source on GitHub ↗

Get SpiderLoader instance from settings

(settings: BaseSettings)

Source from the content-addressed store, hash-verified

23
24
25def get_spider_loader(settings: BaseSettings) -> SpiderLoaderProtocol:
26 """Get SpiderLoader instance from settings"""
27 cls_path = settings.get("SPIDER_LOADER_CLASS")
28 loader_cls = load_object(cls_path)
29 verifyClass(ISpiderLoader, loader_cls)
30 return cast("SpiderLoaderProtocol", loader_cls.from_settings(settings.frozencopy()))
31
32
33class SpiderLoaderProtocol(Protocol):

Callers 5

__init__Method · 0.90
runMethod · 0.90
_spider_existsMethod · 0.90
runMethod · 0.90

Calls 4

load_objectFunction · 0.90
frozencopyMethod · 0.80
getMethod · 0.45
from_settingsMethod · 0.45

Tested by 1

Used in the wild real call sites across dependent graphs

searching dependent graphs…