Primary interface for browser tab automation via CDP, handling navigation, DOM manipulation, JS execution, event monitoring, and specialized tasks like Cloudflare bypass.
class Tab(FindElementsMixin):
"""
Controls a browser tab via Chrome DevTools Protocol.
Primary interface for web page automation including navigation, DOM manipulation,
JavaScript execution, event handling, network monitoring, and specialized tasks
like Cloudflare bypass.
"""
def __init__(
self,
browser: Browser,
connection_port: Optional[int] = None,
target_id: Optional[str] = None,
browser_context_id: Optional[str] = None,
ws_address: Optional[str] = None,
connection_handler: Optional[ConnectionHandler] = None,
):
"""
Initialize tab controller for existing browser tab.
Args:
browser: Browser instance that created this tab.
connection_port: CDP WebSock
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search 40K more like it.
Get a free API key