title: selenium count elements of xpath
body: <p>i have a webpage with a table containing many Download links
  i want to let selenium click on the last one :</p>
  
  <p>table:</p>
  
  <pre><code>item1 Download
  item2 Download
  item3 Download
  </code></pre>
  
  <p>selenium must click on <code>Download</code> next <code>item3</code></p>
  
  <p>i used xpath to find all elments then get size of returned array or dict in this way</p>
  
  <pre><code>x = bot._driver.find_element_by_xpath("//a[contains(text(),'Download')]").size()
  </code></pre>
  
  <p>but i get always this error </p>
  
  <pre><code>TypeError: 'dict' object is not callable
  </code></pre>
  
  <p>i tried to use <code>get_xpath_count</code> methode but the methode doen't exist in selenium in python!</p>
  
  <p>i thought about another solution but i don't know how to do it and it is as following</p>
  
  <pre><code>x = bot._driver.find_element_by_xpath("(//a[contains(text(),'Download')])[size()-1]")
  </code></pre>
  
  <p>or</p>
  
  <pre><code>x = bot._driver.find_element_by_xpath("(//a[contains(text(),'Download')])[last()]")
  </code></pre>
  
  <p>or something else</p>