title: Control Firefox Download Prompt Using Selenium and Python
body: <p>Here is my code :</p>
  
  <pre><code>from selenium import webdriver
  from selenium.webdriver.support.ui import WebDriverWait
  
  profile = webdriver.FirefoxProfile()
  profile.set_preference("browser.download.folderList", 2);
  profile.set_preference("browser.download.manager.showWhenStarting", False)
  profile.set_preference("browser.download.dir", "/home/ripundeep/Desktop/Python Challenges /")    
  profile.set_preference("browser.helperApps.alwaysAsk.force", False)
  profile.set_preference("browser.download.manager.alertOnEXEOpen", False)
  profile.set_preference("browser.download.manager.focusWhenStarting", False)
  profile.set_preference("browser.download.manager.useWindow", False)
  profile.set_preference("browser.download.manager.showAlertOnComplete", False)
  profile.set_preference("browser.download.manager.closeWhenDone", False)
  profile.set_preference("browser.helperApps.neverAsk.openFile","text/csv")
  profile.set_preference("browser.helperApps.neverAsk.saveToDisk","text/csv")
  profile.update_preferences()
  
  driver = webdriver.Firefox(firefox_profile=profile)
  driver.get(url)
  driver.find_element_by_css_selector("#id").send_keys("keyword")
  WebDriverWait(driver, 1, poll_frequency=0.1).until(lambda drv:  len(drv.find_elements_by_css_selector("#ctl00_ContentPlaceHolder1_btnSubmit")) &gt; 0)
  driver.find_element_by_css_selector("#submitid").click()
  driver.find_element_by_css_selector("#DownloadLinkId").click()
  </code></pre>
  
  <p>I want to stop firefox to show me download prompt and save it automatically and I have tried all possible solutions but didn't work. Please help. </p>