How to change download.default_directory option?

Hi guys,

I use Python and try change default folder for downloads. Now all downloads are going to standard ‘Downloads’ folder. I tried this:

download_preferences = {
    "download.default_directory": "/upload"
}
def open_the_website(url: str):
    browser.open_available_browser(url, preferences=download_preferences)

But there is no changes. Downloaded files are not in ‘/upload’ directory.

Did you already try Set Download Directory keyword of RPA.Browser.Selenium library ?

Yes, I tried and there are no changes.

from RPA.Browser.Selenium import Selenium

url = "http://my_url"
download_preferences = {
    "download.default_directory": "/upload"
}

browser = Selenium()
browser.set_download_directory(directory='/upload')


def open_the_website(url: str):
    browser.open_available_browser(url, preferences=download_preferences)

I would try to give absolute path to the download directory. I don’t think that relative path without any origin has much hope for success.

Now it works! Thank you.
Yes, chrome driver needs absolute path, it knows nothing about my relative path.

1 Like