Create a `RobotsTxtFile` instance from the given content. Args: url: The URL associated with the robots.txt file. content: The raw string content of the robots.txt file to be parsed.
(cls, url: str, content: str)
| 36 | |
| 37 | @classmethod |
| 38 | async def from_content(cls, url: str, content: str) -> Self: |
| 39 | """Create a `RobotsTxtFile` instance from the given content. |
| 40 | |
| 41 | Args: |
| 42 | url: The URL associated with the robots.txt file. |
| 43 | content: The raw string content of the robots.txt file to be parsed. |
| 44 | """ |
| 45 | robots = Protego.parse(content) |
| 46 | return cls(url, robots) |
| 47 | |
| 48 | @classmethod |
| 49 | async def load(cls, url: str, http_client: HttpClient, proxy_info: ProxyInfo | None = None) -> Self: |