Skip to content

Commit 74aacf8

Browse files
authored
docs: fix docs for transform_request_function (#1416)
### Description - Fix docs for `transform_request_function`
1 parent 8f33393 commit 74aacf8

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

docs/introduction/03_adding_more_urls.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ For even more control, you can use the `include` or `exclude` parameters, either
109109

110110
### Transform requests before enqueuing
111111

112-
For cases where you need to modify or filter requests before they are enqueued, you can use the `transform_request_function` parameter. This function takes a <ApiLink to="class/Request">`Request`</ApiLink> object as input and should return either a modified <ApiLink to="class/Request">`Request`</ApiLink>` object or `None`. If the function returns `None`, the request will be skipped.
112+
For cases where you need to modify or filter requests before they are enqueued, you can use the `transform_request_function` parameter. This function receives a <ApiLink to="class/RequestOptions">`RequestOptions`</ApiLink> object and should return either a modified <ApiLink to="class/RequestOptions">`RequestOptions`</ApiLink> object, or a string of type `RequestTransformAction`, which only allows the values `skip` and `unchanged`. Returning `skip` means the request will be skipped, while `unchanged` will add it without any changes
113113

114114
<RunnableCodeBlock className="language-python" language="python">
115115
{TransformExample}

src/crawlee/_request.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ def __hash__(self) -> int:
117117
user_data_adapter = TypeAdapter(UserData)
118118

119119

120+
@docs_group('Other')
120121
class RequestOptions(TypedDict):
121122
"""Options that can be used to customize request creation.
122123

0 commit comments

Comments
 (0)