Selenium Webdriver in Python – files download directory change in Chrome preferences

The following worked for me:

chromeOptions = webdriver.ChromeOptions()
prefs = {"download.default_directory" : "/some/path"}
chromeOptions.add_experimental_option("prefs",prefs)
chromedriver = "path/to/chromedriver.exe"
driver = webdriver.Chrome(executable_path=chromedriver, options=chromeOptions)

Source: https://sites.google.com/a/chromium.org/chromedriver/capabilities

Leave a Comment