title: How to click on specific download link when there are number of divs containing download link with Selenium webdriver in python
body: <p>I want to download F&amp;O Bhavcopy from </p>
  
  <blockquote>
    <p>"<a href="https://www.nseindia.com/all-reports-derivatives#cr_deriv_equity_archives" rel="nofollow noreferrer">https://www.nseindia.com/all-reports-derivatives#cr_deriv_equity_archives</a>" </p>
  </blockquote>
  
  <p>using selenium in Python.</p>
  
  <p>F&amp;O Bhavcopy is in 1 of the div.there is download link in that div.</p>
  
  <p>I have tried folowwing code:</p>
  
  <pre><code>WebDriverWait(driver,10).until(EC.element_to_be_clickable((By.XPATH,"//div[@class='card-body']/span[@class='reportDownloadIcon']/a[@class='pdf-download-link']"))).click()
  </code></pre>
  
  <p>OR</p>
  
  <pre><code>driver.find_element_by_xpath("//div[@class='card-body']/span[@class='reportDownloadIcon']/a").click()
  </code></pre>
  
  <p>OR</p>
  
  <pre><code>driver.find_element_by_css_selector("div.card-body span.reportDownloadIcon a.pdf-download-link").click()
  </code></pre>
  
  <p>Nothing worked for me.because there are number of div's which consist of download link. I want to click on specific download link .</p>
  
  <p>Thanks in advance.</p>