title: Finding an element and clicking on it using Selenium and Python
body: <p>I am making a script that will navigate through a website and perform some actions for me. But I am stuck trying to make my script click on the following elemnt:</p>
  <pre><code>&lt;a href=&quot;JavaScript:OnCopy(22291488);&quot; title=&quot;Copy Trip&quot;&gt;&lt;img src=&quot;../Images/copy.gif&quot;&gt;&lt;/a&gt;
  </code></pre>
  <p>As there is no ID or class name for this element, i tried to find the element by xpath and clicking on it by using the following code:</p>
  <pre><code>import selenium
  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
  from selenium.webdriver.common.keys import Keys
  import time
  </code></pre>
  <p>....</p>
  <pre><code>copy = driver.find_element_by_xpath('//[@id=&quot;divGrid&quot;]/div[2]/div[2]/table/tbody/tr[1]/td[1]/div/span/a[2]')
  copy.click()
  </code></pre>
  <p>This isn't working, so I am open to suggestions to how to solve this issue.</p>