Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Selenium: Prevent download dialog and download file automatically
# adapted from
profile = webdriver.FirefoxProfile()
profile.set_preference('', 2) # custom location
profile.set_preference('', False)
profile.set_preference('browser.helperApps.neverAsk.saveToDisk', 'text/vcard') # type of file to download
# use the out folder of the script path
profile.set_preference('', os.path.join(os.path.dirname(os.path.abspath(__file__)), 'out'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment