Profile preferences doesn't apply in Selenium Python

Here is my code. I try to download file using selenium so I want to disable pop-up save window but all I’ve tried didn’t work for me. Save window keep showing up. I use Mozilla Firefox and Windows 10.

from selenium import webdriver
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.common.keys import Keys 

profile = webdriver.FirefoxProfile()
profile.set_preference("", 2)
profile.set_preference("", False)
profile.set_preference("", "./")
profile.set_preference("browser.helperApps.neverAsk.saveToDisk", "attachment/csv")
binary = '/Users/User/Documents/Geckodriver/geckodriver.exe'
browser = webdriver.Firefox(executable_path = binary, firefox_profile = profile)

If it is important I use Firefox as my regular browser maybe it can somehow affect geckodriver.

1 Like