MCPcopy Create free account
hub / github.com/cxapython/catvm / from_crawler

Method from_crawler

selenium/scrapy_splash/middleware.py:233–242  ·  view source on GitHub ↗
(cls, crawler)

Source from the content-addressed store, hash-verified

231
232 @classmethod
233 def from_crawler(cls, crawler):
234 splash_base_url = crawler.settings.get('SPLASH_URL',
235 cls.default_splash_url)
236 log_400 = crawler.settings.getbool('SPLASH_LOG_400', True)
237 slot_policy = crawler.settings.get('SPLASH_SLOT_POLICY',
238 cls.default_policy)
239 if slot_policy not in SlotPolicy._known:
240 raise NotConfigured("Incorrect slot policy: %r" % slot_policy)
241
242 return cls(crawler, splash_base_url, slot_policy, log_400)
243
244 def spider_opened(self, spider):
245 if not hasattr(spider, 'state'):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected