MCPcopy
hub / github.com/scrapy/scrapy / __init__

Method __init__

scrapy/robotstxt.py:90–96  ·  view source on GitHub ↗
(self, robotstxt_body: bytes, spider: Spider | None)

Source from the content-addressed store, hash-verified

88
89class RerpRobotParser(RobotParser):
90 def __init__(self, robotstxt_body: bytes, spider: Spider | None):
91 from robotexclusionrulesparser import RobotExclusionRulesParser # noqa: PLC0415
92
93 self.spider: Spider | None = spider
94 self.rp: RobotExclusionRulesParser = RobotExclusionRulesParser()
95 body_decoded = decode_robotstxt(robotstxt_body, spider)
96 self.rp.parse(body_decoded)
97
98 @classmethod
99 def from_crawler(cls, crawler: Crawler, robotstxt_body: bytes) -> Self:

Callers

nothing calls this directly

Calls 2

decode_robotstxtFunction · 0.85
parseMethod · 0.45

Tested by

no test coverage detected