Router
crawlee.router.Router
Index
Constructors
Methods
Constructors
__init__
Returns None
Methods
__call__
Invoke a request handler that matches the request label (or the default).
Parameters
context: TCrawlingContext
Returns None
default_handler
A decorator used to register a default handler.
The default handler is invoked for requests that have either no label or a label for which we have no matching handler.
Parameters
handler: RequestHandler[TCrawlingContext]
Returns RequestHandler[TCrawlingContext]
handler
A decorator used to register a label-based handler.
The registered will be invoked only for requests with the exact same label.
Parameters
label: str
Returns Callable[[RequestHandler[TCrawlingContext]], None]
Dispatches requests to registered handlers based on their labels.