title: Can't trigger a click on a certain link using selenium
body: <p>I've written a script in python with selenium to click on a certain link in a webpage to download an excel file. However, when I execute my script, it throws <code>timeout</code> exception. How can I make it work? Any help will be greatly appreciated.</p>
  
  <p>Link to the site: <a href="https://www.baseball-reference.com/play-index/batter_vs_pitcher.cgi?batter=mancitr01" rel="nofollow noreferrer">webpage</a></p>
  
  <p>Script I've tried with:</p>
  
  <pre><code>from selenium import webdriver
  from selenium.webdriver.common.by import By
  from selenium.webdriver.support.ui import WebDriverWait
  from selenium.webdriver.support import expected_conditions as EC
  
  driver = webdriver.Chrome()
  wait = WebDriverWait(driver, 10)
  driver.get('replace_with_above_link')
  
  item = wait.until(EC.visibility_of_element_located((By.CSS_SELECTOR, ".hasmore #dlink")))
  item.click()
  driver.quit()
  </code></pre>
  
  <p>Html elements which contain the dropdown options:</p>
  
  <pre><code>&lt;li class="hasmore drophover"&gt;&lt;span&gt;Share &amp;amp; more&lt;/span&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;button class="tooltip" tip="Use a customizable report creator that can&lt;br&gt;output HTML, CSV, or a shareable link." id="share_on_ajax_result_table"&gt;Modify &amp;amp; Share Table&lt;/button&gt;&lt;/li&gt;&lt;li&gt;&lt;button class="tooltip" tip="Get a bit of widget code to emed this table on your site"&gt;Embed this Table&lt;/button&gt;&lt;/li&gt;&lt;li&gt;&lt;button class="tooltip" tip="Convert the table below to comma-separated values&lt;br&gt;suitable for use with excel"&gt;Get as Excel Workbook (experimental)&lt;/button&gt;&lt;a id="dlink" style="display: none;"&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;button class="tooltip" tip="Export table as &lt;br&gt;suitable for use with excel"&gt;Get table as CSV (for Excel)&lt;/button&gt;&lt;/li&gt;&lt;li&gt;&lt;button class="tooltip" tip=""&gt;Strip Mobile Formatting&lt;/button&gt;&lt;/li&gt;&lt;li&gt;&lt;a id="a_ajax_result_table" name="ajax_result_table" href="#ajax_result_table::none"&gt;Copy Link to Table to Clipboard&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;button class="tooltip" tip=""&gt;About Sharing Tools&lt;/button&gt;&lt;/li&gt;&lt;li&gt;&lt;button class="tooltip" tip=""&gt;&lt;a href="https://www.youtube.com/watch?v=MWapXbaWs_U&amp;amp;feature=youtu.be" target="_blank"&gt;Video: SR Sharing Tools &amp;amp; How-to&lt;/a&gt;&lt;/button&gt;&lt;/li&gt;&lt;li&gt;&lt;button class="tooltip" tip=""&gt;&lt;a href="https://www.youtube.com/watch?v=JkDLV0roT14&amp;amp;feature=youtu.be" target="_blank"&gt;Video: Stats Table Tips &amp;amp; Tricks&lt;/a&gt;&lt;/button&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;/li&gt;
  </code></pre>
  
  <p>Location of that file in that webpage (the desired link is marked with pencil):
  <a href="https://i.stack.imgur.com/2CyNR.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2CyNR.jpg" alt="enter image description here"></a></p>