CDP-Patches
CDP-Patches copied to clipboard
[BUG] Fails when using with Botright
Describe the bug Can't use it with Botright, can not init AsyncInput when browser is Botright
Code Sample
async def runnnn():
from cdp_patches.input import AsyncInput
botright_client = await botright.Botright()
proxy = "user:pass@host:port"
browser = await botright_client.new_browser(proxy=proxy)
# open a new page
page = await browser.new_page()
page.goto('https://horrods.com')
async_input = await AsyncInput(browser=browser) <- fails here
await async_input.click("left", 100, 100)
To Reproduce
Steps to reproduce the behavior:
Code above fails on the specified line because of this assertion:
Since Botright creates playwright browser using persistent context and in that case
browser.browser
returns None