F
F
fandorin_official2020-01-23 17:21:12
Python
fandorin_official, 2020-01-23 17:21:12

How to properly configure the driver to download a file without a dialog box?

There is a task to download a file from a site. No dialog box.
5e29abea53cc9010884488.jpeg
Unable to configure driver. I'm trying to configure with the following settings:

profile = FirefoxProfile()
            profile.set_preference("browser.download.folderList", 2)
            profile.set_preference("browser.download.manager.showWhenStarting", False)
            profile.set_preference("browser.download.dir", "c:\\firefox_downloads\\")
            profile.set_preference("browser.helperApps.neverAsk.saveToDisk", "image/jpeg")

but when I try to download it still pops up a dialog box. How to get away from it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
alex1478, 2020-01-23
@alex1478

profile.set_preference("browser.download.folderList", 2)
profile.set_preference("browser.download.manager.showWhenStarting", False)
profile.set_preference("browser.helperApps.neverAsk.saveToDisk", 'image/jpeg,image/png,application/octet-stream')

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question