Skip to content

[🚀 Feature]: Synchronous DevTools/BiDi in Python #13975

Open
@p0deje

Description

@p0deje

Feature and motivation

Implement DevTools/BiDI in Python bindings that don't require using the async/await pattern. The proof-of-concept is implemented in 83112e1.

Usage example

For now, provide lower-level API that can use DevTools/CDP directly. The high-level API will be added later on top of this.

from selenium.webdriver.common.bidi import cdp
devtools = cdp.import_devtools(version)

# execute commands
driver.bidi().execute(devtools.runtime.enable())

# subscribe to events
console_api_calls = [] 
driver.bidi().on(devtools.runtime.ConsoleAPICalled, lambda e: console_api_calls.append(e))

Metadata

Metadata

Assignees

No one assigned

    Labels

    B-devtoolsIncludes everything BiDi or Chrome DevTools relatedC-pyPython BindingsI-enhancementSomething could be better

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions