title: XPath to locate a cell with specific text parsing HTML tables
body: <p>Hope someone out there can quickly point me in the right direction with my XPath difficulties.</p>
  
  <p>Current I've got to the point where I'm identifying the correct table i need in my HTML source but then I need to process only the rows that have the text 'Chapter' somewhere in the DOM.</p>
  
  <p>My last attempt was to do this : </p>
  
  <pre><code>// get the correct table
  HtmlTable table = page.getFirstByXPath("//table[2]");
  
  // now the failing bit....
  def rows = table.getByXPath("*/td[contains(text(),'Chapter')]") 
  </code></pre>
  
  <p>I thought the xpath above would represent, get me all elements that have a following child element of 'td' that somewhere in its dom contains the text 'Chapter'</p>
  
  <p>An example of a matching row from my source is : </p>
  
  <pre><code>&lt;tr valign="top"&gt;
    &lt;td nowrap="" align="Right"&gt;
     &lt;font face="Verdana"&gt;
     &lt;a href="index.cfm?a=1"&gt;Chapter 1&lt;/a&gt;
     &lt;/font&gt;
    &lt;/td&gt;
    &lt;td class="ChapterT"&gt;
      &lt;font face="Verdana"&gt;DEFINITIONS&lt;/font&gt;
    &lt;/td&gt;
    &lt;td&gt;&amp;nbsp;&lt;/td&gt;
  &lt;/tr&gt;
  </code></pre>
  
  <p>Any help / pointers greatly appreciated.</p>
  
  <p>Thanks,</p>