title: Python - Select "Save link as" and save a file using Selenium
body: <p>Newbie: There are different files on a webpage, which can be downloaded as follows:
  1. Right click on a file link
  2. Select "Save link as"
  3. Click "Save" button on the new window.</p>
  
  <p>I tried the following code(for first 2 steps), but it is not working:</p>
  
  <pre><code>    from selenium import webdriver
      from selenium.webdriver import ActionChains
      from selenium.webdriver.common.keys import Keys
      import time
  
      driver = webdriver.Chrome()
      driver.maximize_window() 
  
      driver.get('www.example.com')
      time.sleep(1)
  
      driver.find_element_by_link_text("MarketFiles/").click()
  
  
      actionChains = ActionChains(driver)
  
      download_file = "Market_File1.csv"
      link = driver.find_element_by_link_text(download_file)
  
      actionChains.context_click(link).send_keys(Keys.ARROW_DOWN).send_keys(Keys.ARROW_DOWN).send_keys(Keys.ARROW_DOWN).send_keys(Keys.ARROW_DOWN).send_keys(Keys.RETURN).perform();
  </code></pre>
  
  <p>Kindly suggest how to download the file using these 3 steps. Thanks</p>