title: How to handle Save File dialog box in firefox using selenium with python?
body: <p>I'm trying to download .csv file using selenium tool in python but after clicked on save file link in web page, the browser is showing me dialog box.I tried "alert" to handle this but it gives me error like, alert is not present....
  I'm using python as a scripting language and selenium as a tool.
   here is the my code:</p>
  
  <pre><code>fp = webdriver.FirefoxProfile()
  fp.set_preference('browser.download.folderList', 2) # custom location
  fp.set_preference('browser.download.manager.showWhenStarting', False)
  fp.set_preference('browser.download.dir', 'C:\Temp\')
  fp.set_preference('browser.helperApps.neverAsk.saveToDisk', 'application/csv,text/csv,text/comma-separated-values, application/octet-stream')
  driver = webdriver.Firefox(profile)
  driver.window_handles
  driver.swich_to_window(driver.window_handles[0])
  url=''
  driver.get(url)
  pass=driver.find_element_by_id('pswd')
  pass.send_keys('xyz123')
  driver.find_element_by_id('btnLogin').click()
  driver.implicitly_wait(30)
  driver.find_element_by_link_text('FileName').click()
  driver.switch_to_alert().accept()
  </code></pre>