title: Downloading zip files using Python Selenium
body: <p>I'm trying to download every country's "administrative areas" from this website: <a href="http://www.diva-gis.org/gdata" rel="nofollow noreferrer">http://www.diva-gis.org/gdata</a>.</p>
  
  <p>I'm new to using the Python Selenium package, but I'm fairly certain the code below should at least download Afghanistan's data.</p>
  
  <pre><code>from selenium import webdriver
  from selenium.webdriver.common.keys import Keys
  
  profile = webdriver.FirefoxProfile()
  profile.set_preference('browser.download.folderList', 2) # custom location
  profile.set_preference('browser.download.manager.showWhenStarting', False)
  profile.set_preference('browser.download.dir', '/tmp')
  profile.set_preference('browser.helperApps.neverAsk.saveToDisk', 'text/csv')
  
  driver = webdriver.Firefox(profile)
  driver.get("http://www.diva-gis.org/gdata")
  driver.find_element_by_name('OK').click()
  driver.find_element_by_link_text('Download').click()
  </code></pre>
  
  <p>I'm able to open other links on the same page using this method, but I can't open the "Download" link for some reason. No error message is shown after running this code. I did look at similar SO posts, but I still don't know what's wrong.</p>