How ttlns/undetected-playwright-python works
This repository is a Python patch of Playwright focused on Chromium automation. The main workflow is that a Python caller enters the async or sync API, launches a browser, creates a page, and navigates or interacts with it; the README demonstrates both API styles. Internally, API objects send commands through a connection and transport, while page/frame and locator objects expose browser interaction. The README documents Chromium-only patching, but the sampled excerpts do not show its implementation. Other subsystems are represented where the source index or excerpts support them; unsampled details and links are omitted.
Main entry points: _connection.py Protocol connection · _frame.py Frame operations · _browser_context.py Browser context · __init__.py Async API
Components 23
Python APIs
- Async API
undetected_playwright/async_api/__init__.py - Sync API
undetected_playwright/sync_api/__init__.py - Async context
undetected_playwright/async_api/_context_manager.py - Sync context
undetected_playwright/sync_api/_context_manager.py
Browser Runtime
- Driver startup
undetected_playwright/_impl/_driver.py - Playwright root
undetected_playwright/_impl/_playwright.py - Protocol connection
undetected_playwright/_impl/_connection.py - Protocol transport
undetected_playwright/_impl/_transport.py - Chromium patch
undetected_playwright/_impl
Page Interaction
- Browser context
undetected_playwright/_impl/_browser_context.py - Page and frames
undetected_playwright/_impl/_page.py - Frame operations
undetected_playwright/_impl/_frame.py - Locators
undetected_playwright/_impl/_locator.py - Element handles
undetected_playwright/_impl/_element_handle.py
Network and Checks
- Network routing
undetected_playwright/_impl/_network.py - API requests
undetected_playwright/_impl/_fetch.py - Assertions
undetected_playwright/_impl/_assertions.py
Shared Internals
- API structures
undetected_playwright/_impl/_api_structures.py - Runtime helpers
undetected_playwright/_impl/_helper.py - Wait coordination
undetected_playwright/_impl/_waiter.py - Error types
undetected_playwright/_impl/_errors.py
Other components
- Python caller
- Chromium browser
Connections 28
- Python caller → Async API: uses async
README.md - Python caller → Sync API: uses sync
README.md - Async API → Async context: enters context
undetected_playwright/async_api/__init__.py - Sync API → Sync context: enters context
undetected_playwright/sync_api/__init__.py - Async context → Driver startup: starts driver
undetected_playwright/async_api/_context_manager.py - Sync context → Driver startup: starts driver
undetected_playwright/sync_api/_context_manager.py - Async context → Protocol connection: creates connection
undetected_playwright/async_api/_context_manager.py - Sync context → Protocol connection: creates connection
undetected_playwright/sync_api/_context_manager.py - Protocol connection → Protocol transport: sends protocol
undetected_playwright/_impl/_connection.py - Protocol connection → Playwright root: creates objects
undetected_playwright/_impl/_connection.py - Playwright root → Chromium browser: launches browser
README.md - Chromium browser → Browser context: creates context
- Browser context → Page and frames: manages pages
undetected_playwright/_impl/_browser_context.py - Page and frames → Frame operations: uses frames
undetected_playwright/_impl/_page.py - Frame operations → Protocol connection: sends commands
undetected_playwright/_impl/_frame.py - Locators → Frame operations: delegates actions
undetected_playwright/_impl/_locator.py - Locators → Element handles: returns handles
undetected_playwright/_impl/_locator.py - Browser context → Network routing: handles routes
undetected_playwright/_impl/_browser_context.py - Page and frames → Network routing: routes requests
undetected_playwright/_impl/_page.py - API requests → Protocol connection: sends fetch
undetected_playwright/_impl/_fetch.py - Async API → Assertions: exposes assertions
undetected_playwright/async_api/__init__.py - Sync API → Assertions: exposes assertions
undetected_playwright/sync_api/__init__.py - Assertions → Locators: checks locators
undetected_playwright/_impl/_assertions.py - Frame operations → Wait coordination: coordinates waits
undetected_playwright/_impl/_frame.py - Browser context → API structures: uses options
undetected_playwright/_impl/_browser_context.py - Frame operations → Runtime helpers: matches URLs
undetected_playwright/_impl/_frame.py - Protocol connection → Error types: parses errors
undetected_playwright/_impl/_connection.py - Python caller → Chromium patch: uses patched Chromium
README.md