CDP-Patches icon indicating copy to clipboard operation
CDP-Patches copied to clipboard

[BUG] Fails when using with Botright

Open johnyttt opened this issue 7 months ago • 0 comments

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: image Since Botright creates playwright browser using persistent context and in that case browser.browser returns None

johnyttt avatar Jul 24 '24 13:07 johnyttt