The browser is initialized as follows:

from selenium import webdriver from selenium.webdriver.firefox.options import Options as FirefoxOptions options = FirefoxOptions() options = FirefoxOptions() profile = webdriver.FirefoxProfile() profile.set_preference("browser.download.folderList", 2) profile.set_preference("browser.download.manager.showWhenStarting", False) profile.set_preference("browser.download.manager.useWindow", True) profile.set_preference("browser.download.dir", "" + dwnld_path + "") profile.set_preference("browser.helperApps.neverAsk.saveToDisk", "application/pdf,application/msword,text/csv") self.wd = webdriver.Firefox(firefox_profile=profile, options=options, capabilities={"marionette": True}, executable_path="" + wd_path + "/geckodriver.exe", firefox_binary="C:/Program Files/Mozilla Firefox 60/firefox.exe") 

But, nevertheless, when loading a file, a dialog box still appears, with which nothing happens.

From here there was a question: and Firefox in general can save files which are downloaded not according to the link, and podsovyvayutsya through JS?

    1 answer 1

    The case turned out to be in the default setting of "Preview PDF", which was decided by an additional preference:

     profile.set_preference("pdfjs.disabled", True) 
    • Change the name and text of the question, so that another person could find it if he looks for how to disable the PDF auto preview, and how to download the file without confirmation. And also mark your answer as accepted. - AtachiShadow
    • Thank you, the title has been updated ... but to mark the decision, you need to wait another 2 hours) - Sergei
    • Thank you)) One more useful answer)))) - AtachiShadow