title: python selenium doesnot bypass firefox download dialog even though preferences have been set
body: <p>I am trying to download file (market Summary (Closing) — ZIP  ) from the following link:
  <a href="https://dps.psx.com.pk/downloads" rel="nofollow noreferrer">https://dps.psx.com.pk/downloads</a></p>
  
  <p>Here is my code:</p>
  
  <pre><code>from datetime import date
  from selenium import webdriver
  from selenium.webdriver.common.keys import Keys
  from selenium.common.exceptions import ElementClickInterceptedException
  from selenium.webdriver.common.by import By
  from selenium.webdriver.support.ui import WebDriverWait
  from selenium.webdriver.support import expected_conditions as EC
  from selenium.common.exceptions import TimeoutException
  import time
  
  profile = webdriver.FirefoxProfile()
  profile.set_preference("browser.preferences.instantApply",True)
  profile.set_preference("browser.helperApps.neverAsk.saveToDisk", "text/csv")
  profile.set_preference("browser.helperApps.alwaysAsk.force",False)
  profile.set_preference("browser.download.manager.showWhenStarting",False)
  profile.set_preference("browser.download.folderList",0)
  
  
  driver = webdriver.Firefox(firefox_profile=profile)
  driver.get('https://dps.psx.com.pk/downloads')
  
  start_date = driver.find_element_by_id('downloadsDatePicker')
  start_date.send_keys(Keys.BACKSPACE*10)
  send_date = date(2014,1,1).strftime("%Y-%m-%d")
  start_date.send_keys(send_date)
  driver.find_element_by_id('downloadsSearchBtn').click()
  link = '/download/mkt_summary/{}.Z'.format(send_date)
  time.sleep(5)
  driver.find_element_by_css_selector("a[href='{}'".format(link)).click()
  </code></pre>
  
  <p>Even though I have set the preferences, firefox still pops up a download dialog box. Why is it so and how can I avoid this behavior?</p>