MCPcopy Create free account
hub / github.com/apify/crawlee-python / from_content

Method from_content

src/crawlee/_utils/robots.py:38–46  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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:

Calls 1

parseMethod · 0.45