Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion src/crawlee/_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,24 @@ def get_query_param_from_url(self, param: str, *, default: str | None = None) ->


class Request(BaseRequestData):
"""A crawling request (as returned from a request queue)."""
"""Represents a request in the Crawlee framework, containing the necessary information for crawling operations.

The `Request` class is one of the core components in Crawlee, utilized by various components such as request
providers, HTTP clients, crawlers, and more. It encapsulates the essential data for executing web requests,
including the URL, HTTP method, headers, payload, and user data. The user data allows custom information
to be stored and persisted throughout the request lifecycle, including its retries.

Key functionalities include managing the request's identifier (`id`), unique key (`unique_key`) that is used
for request deduplication, controlling retries, handling state management, and enabling configuration for session
rotation and proxy handling.

The recommended way to create a new instance is by using the `Request.from_url` constructor, which automatically
generates a unique key and identifier based on the URL and request parameters.

```python
request = Request.from_url('https://crawlee.dev')
```
"""

id: str

Expand Down