Open QuentiumYT opened 3 years ago
Also refers to #194, #213 and #211
A damn, that's right. I still need to push rewritten options , but no pc at hand now
How is it going? Seems that problem still occurs :(
Any news? :((
Well, I found a way using a browser command:
browser = uc.Chrome()
# Defines autodownload and download PATH
params = {
"behavior": "allow",
"downloadPath": os.getcwd()
}
browser.execute_cdp_cmd("Page.setDownloadBehavior", params)
I hope it will help π @janjelonek @Bl3sk
Well, I found a way using a browser command:
browser = uc.Chrome() # Defines autodownload and download PATH params = { "behavior": "allow", "downloadPath": os.getcwd() } browser.execute_cdp_cmd("Page.setDownloadBehavior", params)
I hope it will help π @janjelonek @Bl3sk
Thanks for trying to helpβ₯, but I need to fix error with prefs, because I need to disable popups. :(
If you want to disable popups, you can do
chrome_options.add_argument("--disable-popup-blocking")
It should work @Bl3sk, else, we need a little fix for prefs :)
It didnt crash, but doesnt work. :( Popups still appears.
options = uc.ChromeOptions() options.add_argument("--disable-popup-blocking") driver = uc.Chrome(options=options) driver.maximize_window() driver.get("https://www.seznam.cz/")
Any update on this? I need to use experimental_option to automatically accept a location requested popup.
@frederikme As a temporary fix, you should use cdp commands
browser.execute_cdp_cmd(
"Browser.grantPermissions",
{
"origin": "https://yourwebsite/",
"permissions": ["geolocation"]
},
)
It should be working, but it's per website only
@QuentiumYT Works like a charm! Thanks! :-)
Prefs still not working
I don't know how or why v2 came to be without support for full chrome_options/ChromeOptions, but until it gets it, many features such as image disabling, proxy support, detatch, etc will not work or not work without workarounds that don't work as-well.
Mind you this also breaks compatibility with seleniumwire_options, the main project UC is used with.
I suggest anyone that needs this go back to using v1 as I have.
import undetected_chromedriver._compat as uc
Hope this issue wasn't abandoned...
Please check this potential solution
Well, I found a way using a browser command:
browser = uc.Chrome() # Defines autodownload and download PATH params = { "behavior": "allow", "downloadPath": os.getcwd() } browser.execute_cdp_cmd("Page.setDownloadBehavior", params)
I hope it will help π @janjelonek @Bl3sk
This is good, But I need to set the download location in uc.Chrome() as I am deploying the application on AWS Lambda. Unfortunately, If I do not do that. the uc.Chrome is trying to write to a read-only file on AWS and I am getting this error. I basically need to write to /tmp on OS level. Is there any way to do this?
"errorMessage": "[Errno 30] Read-only file system: '/home/sbx_user1051'",
"errorType": "OSError",
Hello, using Undetected Chromedriver V2, the 'prefs' experimental option isn't valid.
I tried the following code:
but this is also for all other prefs keys, not only download.default_directory.
The error
Thanks for any fix or solution!