Downloading a file at a specified location through python and selenium using Chrome driver

I found the accepted solution didn’t work, however this slight change did:

from selenium import webdriver

chrome_options = webdriver.ChromeOptions()
prefs = {'download.default_directory' : '/path/to/dir'}
chrome_options.add_experimental_option('prefs', prefs)
driver = webdriver.Chrome(chrome_options=chrome_options)

Leave a Comment