You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
JS Crawlee Router supports .use() middleware — functions that run sequentially before every matched route handler. Python Router has no equivalent. Users cannot add cross-cutting concerns (logging, auth, rate limiting) at the router level.
src/crawlee/router.py — simple label-based dispatcher with default_handler and handler(label) decorators, no middleware support. The ContextPipeline provides crawler-level middleware, but not at the router level.
What to implement
Add a use() method to Router that registers pre-handler middleware, matching JS semantics.
Activity
B4nan commentedon Feb 17, 2026
We might want to use decorators in python.
feat: Add `use` to `Router` for middleware support with pre-handler e…