MCPcopy Index your code
hub / github.com/microsoft/playwright-python / route

Method route

playwright/_impl/_page.py:686–700  ·  view source on GitHub ↗
(
        self, url: URLMatch, handler: RouteHandlerCallback, times: int = None
    )

Source from the content-addressed store, hash-verified

684 )
685
686 async def route(
687 self, url: URLMatch, handler: RouteHandlerCallback, times: int = None
688 ) -> DisposableStub:
689 self._routes.insert(
690 0,
691 RouteHandler(
692 self._browser_context._base_url,
693 url,
694 handler,
695 True if self._dispatcher_fiber else False,
696 times,
697 ),
698 )
699 await self._update_interception_patterns()
700 return DisposableStub(lambda: self.unroute(url, handler), self)
701
702 async def unroute(
703 self, url: URLMatch, handler: Optional[RouteHandlerCallback] = None

Calls 4

unrouteMethod · 0.95
RouteHandlerClass · 0.90
DisposableStubClass · 0.90