I am trying to automatically download files from a pop up dialog using selenium-python.
The firefox popups look like this
I've discovered a useful solution that hopefully will help somebody out there.
You can skip the prompt altogether with firefox if you're starting the download with a click by holding the ALT key.
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.action_chains import ActionChains
...
profile.set_preference("browser.altClickSave", True)
...
element = driver.find_element_by_xpath("//a")
ActionChains(driver).key_down(Keys.ALT).click(element).key_up(Keys.ALT).perform()
This should download any file without needing to specify MIME type of anything.