Devin working workaround for pure cdp sync download change 4.49.7 #4375
Closed
shel1kest0learn
started this conversation in
General
Replies: 2 comments
-
|
Download functionality for CDP Mode has been added in (See #4376) |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Methods added 4.49.9 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
The Issue
The Chrome class in sb_cdp inherits from CDPMethods, which wraps async methods from the Tab class to make them synchronous. sb_cdp.py:3328-3346 However, set_download_path is not among the wrapped methods in CDPMethods. sb_cdp.py:22-112
Workaround
You can access the underlying async page object and call the method directly through the event loop:
from seleniumbase import sb_cdp
import pathlib
sb = sb_cdp.Chrome(url)
download_dir = pathlib.Path("/path/to/your/downloads")
Access the async page through the loop
sb.loop.run_until_complete(sb.page.set_download_path(download_dir))
Now downloads will go to the specified directory
sb.driver.stop()
Beta Was this translation helpful? Give feedback.
All reactions