[Python] FireFox keeps asking, "What should Firefox do with this file?" What's the...

Discussão em 'Python' iniciado por Stack, Junho 24, 2025.

  1. Stack

    Stack Membro Participativo

    I'm trying to auto download documents with Firefox via Selenium and Python. I've made some attempts at stopping the automatically generated box but Firefox keeps asking, "What should Firefox do with this file?". What's the about:config setting I need to change or add to the Firefox profile so that I don't get this prompt box? My existing code is below:

    ""

    autodlprofile = webdriver.FirefoxProfile()

    autodlprofile.set_preference("browser.download.folderList", 2)

    #autodlproflie.set_preference("browser.download.alwaysOpenInSystemViewerContextMenuItem", False)

    autodlprofile.set_preference("browser.download.dir", r"C:\Users\X\Desktop\Automate the Boring Stuff\taxbills")

    autodlprofile.set_preference("browser.helperApps.neverAsk.saveToDisk", "application/octet-stream")

    autodlprofile.set_preference("browser.helperApps.neverAsk.openFile", "application/octet-stream")

    autodlprofile.set_preference("browser.helperApps.showOpenOptionForPdfJS", False)

    ""

    Thank you for your time.

    Continue reading...

Compartilhe esta Página