Python Selenium: Firefox neverAsk.saveToDisk when downloading from Blob URL
<p>I wish to have Firefox using <code>selenium</code> for Python to download the <em>Master data (Download, XLSX)</em> Excel file from this <a href="http://www.xetra.com/xetra-en/instruments/etf-exchange-traded-funds/list-of-tradable-etfs" rel="nofollow">Frankfurt stock exchange webpage</a>.</p>

<p>The problem: I can't get Firefox to download the file without asking where to save it first.</p>

<p>Let me first point out that the URL I'm trying to get the Excel file from, is really a Blob URL:</p>

<blockquote>
  <p><a href="http://www.xetra.com/blob/1193366/b2f210876702b8e08e40b8ecb769a02e/data/All-tradable-ETFs-ETCs-and-ETNs.xlsx" rel="nofollow">http://www.xetra.com/blob/1193366/b2f210876702b8e08e40b8ecb769a02e/data/All-tradable-ETFs-ETCs-and-ETNs.xlsx</a></p>
</blockquote>

<p>Perhaps the Blob is causing my problem? Or, perhaps the problem is in my MIME handling?</p>

<pre><code>from selenium import webdriver

profile_dir = "path/to/ff_profile"
dl_dir = "path/to/dl/folder"

ff_profile = webdriver.FirefoxProfile(profile_dir)

ff_profile.set_preference("browser.download.folderList", 2)
ff_profile.set_preference("browser.download.manager.showWhenStarting", False)
ff_profile.set_preference("browser.download.dir", dl_dir)
ff_profile.set_preference('browser.helperApps.neverAsk.saveToDisk', "text/plain, application/vnd.ms-excel, text/csv, text/comma-separated-values, application/octet-stream")

driver = webdriver.Firefox(ff_profile)

url = "http://www.xetra.com/xetra-en/instruments/etf-exchange-traded-funds/list-of-tradable-etfs"
driver.get(url)

dl_link = driver.find_element_by_partial_link_text("Master data")
dl_link.click()
</code></pre>

<p>The actual mime-type to be used in this case is:</p>

<pre><code>application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
</code></pre>

<hr>

<p>How do I know that? Here is what I've done:</p>

<ul>
<li>opened Firefox manually and navigated to the target site</li>
<li>when downloading the file, checked the checkbox to save these kind of files automatically</li>
<li>went to Help -> Troubleshooting Information and navigated to the "Profile Folder"</li>
<li>in the profile folder, foudn and opened <code>mimetypes.rdf</code></li>
<li>inside the <code>mimetypes.rdf</code> found the record/resource corresponding to the excel file I've recently downloaded</li>
</ul>

python selenium firefox blob