I\'m using Selenium Webdriver (in Python) to automate the downloading of thousands of files. I want to set Chrome\'s download folder programmatically. After reading this, I
If anyone is still having trouble and the above solutions didn't work, I found adding a following slash ('\') to my download path.
Mine looked like this:
if browser == 'chrome':
options = webdriver.ChromeOptions()
options.add_argument("--start-maximized")
prefs = {"profile.default_content_settings.popups": 0,
"download.default_directory": r"C:\Users\user_dir\Desktop\\", # IMPORTANT - ENDING SLASH V IMPORTANT
"directory_upgrade": True}
options.add_experimental_option("prefs", prefs)
return webdriver.Chrome(executable_path=Base.chromedriver_dir, chrome_options=options)