WebElement

pydoll · automation, dom-wrapper, browser-automation, cdp-commands, element-interaction

Wraps a DOM element for browser automation via CDP, providing interaction (click, type), inspection (attributes, visibility), and manipulation (screenshot, shadow DOM) with iframe-aware routing.

# Source: https://github.com/autoscrape-labs/pydoll | License: MIT | Copyright 2025 AutoscrapeLabs
# Provided via justclaw.it.com; keep this notice with the code.
class WebElement(FindElementsMixin):  # noqa: PLR0904
    """
    DOM element wrapper for browser automation.

    Provides comprehensive functionality for element interaction, inspection,
    and manipulation using Chrome DevTools Protocol commands.
    """

    if TYPE_CHECKING:
        _routing_session_handler: Optional[ConnectionHandler]
        _routing_session_id: Optional[str]
        _routing_parent_frame_id: Optional[str]

    def __init__(
        self,
        object_id: str,
        connection_handler: ConnectionHandler,
        method: Optional[str] = None,
        selector: Optional[str] = None,
        attributes_l

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search 40K more like it.

Get a free API key