title: Unable to download a CSV file using Selenium Python
body: <p>I am unable to download a CSV file using Selenium Python. The download dialog keep popping up and the file does not get downloaded. </p>
  
  <p>The following is the dialog box I get upon downloading</p>
  
  <p><a href="https://i.stack.imgur.com/eunK1.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/eunK1.png" alt="Dialog Box on downloading"></a></p>
  
  <pre><code>from selenium import webdriver
  from BasePage import BasePage
  from selenium.webdriver.common.by import By
  from selenium.webdriver.common.keys import Keys
  from selenium.webdriver.support.ui import Select
  from selenium.common.exceptions import NoSuchElementException
  from selenium.common.exceptions import NoAlertPresentException
  from selenium.webdriver.common.keys import Keys
  import unittest
  from selenium.webdriver.support.select  import Select
  import time
  from selenium.webdriver.support.ui      import WebDriverWait
  import os
  from selenium.webdriver.firefox.firefox_profile import FirefoxProfile
  
  fp = webdriver.FirefoxProfile()
  
  fp.set_preference("browser.download.folderList",2)
  fp.set_preference("browser.download.manager.showWhenStarting",False)
  fp.set_preference("browser.download.dir", os.getcwd())
  
  fp.set_preference("browser.helperApps.neverAsk.saveToDisk", "test/csv")
  
  # fp.set_preference("pdfjs.disabled", True)
  
  browser = webdriver.Firefox(firefox_profile=fp)
  </code></pre>