title: Clicking on text in between SPAN tags using Selenium Webdriver (java)
body: <p>HTML code looks like this:</p>
  
  <pre><code>&lt;td id="id26a" class="doclisting-name link" style="width: 319px; min-width: 319px;"&gt; 
  
  &lt;span id="id26b" title="Document"&gt;
  &lt;span class="ie-fallback-marker"&gt;
    words
  
  &lt;/span&gt;&lt;/span&gt;&lt;/td&gt;
  </code></pre>
  
  <p>I cannot search for Element ID, as it changes all the time. I cannot search for the element's class, as there are multiples which could change locations.</p>
  
  <p>I want to be able to click on "WORDS" <em>in between</em> the SPAN tags. Is this at all possible?</p>
  
  <p>This is what I used so far, but neither seems to work:</p>
  
  <pre><code>//string document is words.
     public void testscenario123(String document)      throws Throwable {
      Thread.sleep(3000);
      driver.findElement(By.linkText(document)).click();
  }
  </code></pre>
  
  <p>or</p>
  
  <pre><code>  //string document is words.
   public void testscenario124(String document) throws Throwable {
      Thread.sleep(3000);
      driver.findElement(By.xpath("//*[contains(@span,'"+document+"')]")).click();
  }
  </code></pre>