title: XPath to access a text after span
body: <p>I am using Robot Framework trying to access an element in a dynamic table. I am trying to click "TestAuto" text that will lead me to another page but I have great difficulties. I always struggle when "span" is in the code. Hope somebody can give me a pointer to create a proper xpath. Thanks. </p>
  
  <p>The following is the sample code:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;body&gt;
  
  &lt;h1&gt;My First Heading&lt;/h1&gt;
  
  &lt;p&gt;My first paragraph.&lt;/p&gt;
  
  &lt;div class="col-sm-2"&gt;
  &lt;table&gt;
  &lt;tbody&gt;
  &lt;tr data-tryxpath-element="0"&gt;
  &lt;td class="st-m3"&gt;
  &lt;span class="bongobongo"&gt;Name:&lt;/span&gt;
  TestAuto
  &lt;br&gt;
  &lt;span class="bongoemail"&gt;Email:&lt;/span&gt;
  bongo@mail.com
  &lt;br&gt;
  &lt;span class="bongotel"&gt;Phone:&lt;/span&gt;
  +1234567890
  &lt;/td&gt;
  &lt;/tbody&gt;
  &lt;/table&gt;
  &lt;table&gt;
  &lt;tbody&gt;
  &lt;tr data-tryxpath-element="0"&gt;
  &lt;td class="st-m3"&gt;
  &lt;span class="bongobongo"&gt;Name:&lt;/span&gt;
  TestManual
  &lt;br&gt;
  &lt;span class="bongoemail"&gt;Email:&lt;/span&gt;
  bongo123@mail.com
  &lt;br&gt;
  &lt;span class="bongotel"&gt;Phone:&lt;/span&gt;
  +1234567891
  &lt;/td&gt;
  &lt;/tbody&gt;
  &lt;/table&gt;
  &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>I have tried the following xpaths with negative results:</p>
  
  <pre><code>//div/table/tbody/tr/td[starts-with(@class,'table borderless mobile-list')] --&gt; Useless anyway as it does not help to identify "TestAuto"
  //div/table/tbody/tr/td//text()="TestAuto" --&gt; Both tables are selected
  //div/table/tbody/tr/td[normalize-space()='TestAuto'] --&gt; Both tables are selected
  //div/table/tbody/tr/td/span/following::text()="TestAuto" --&gt; Both tables are selected
  </code></pre>