You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Need an USB device with USB debug enabled (connected with ADB)
Requires ppadb playwright and a running ADB server (adb start-server)
importasynciofromplaywright.async_apiimportasync_playwrightfromppadb.clientimportClient# This function worksdefforward(port):
"""Creates a port forwarding for one device"""client=Client()
device=client.devices()[0]
device.forward(local=f"tcp:{port}", remote="localabstract:chrome_devtools_remote")
# This function blocks on the goto()asyncdefrun(port):
"""Connects to a USB device over CDP (via the port forwarding) and visit an URL"""asyncwithasync_playwright() aspw:
browser=awaitpw.chromium.connect_over_cdp(f"http://localhost:{port}")
# Infinite waitawaitbrowser.contexts[0].pages[0].goto("https://google.com")
if__name__=='__main__':
forward_port=9001# Create port forwardingforward(forward_port)
# Run the async functionasyncio.run(run(forward_port))
Describe the bug
The line await browser.contexts[0].pages[0].goto("https://google.com") never returns and the script is stuck in an infinite loop.
My guess is that thegoto method is not compatible with remote CDP:
The browser object is defined with no error
I can open a new page/tab with await browser.contexts[0].new_page()
The browser.contexts[0].pages[0] object is a Page with all the corresponding attributes (including the method goto)
The text was updated successfully, but these errors were encountered:
Context:
1.21.0
3.10.4
Code Snippet
Need an USB device with USB debug enabled (connected with ADB)
Requires
ppadb playwright
and a running ADB server (adb start-server
)Describe the bug
The line
await browser.contexts[0].pages[0].goto("https://google.com")
never returns and the script is stuck in an infinite loop.My guess is that the
goto
method is not compatible with remote CDP:browser
object is defined with no errorawait browser.contexts[0].new_page()
browser.contexts[0].pages[0]
object is aPage
with all the corresponding attributes (including the methodgoto
)The text was updated successfully, but these errors were encountered: