title: Using xpath to select an element based on its grandchildren
body: <p>I am trying to find an element in a webpage based on the child of the child of the element I want. I need this because it is the clickable part of the webpage.</p>
  
  <pre><code>&lt;table id="uniqueId"&gt;
    &lt;tbody&gt;
      &lt;tr&gt;&lt;/tr&gt;
      &lt;tr class="row" onclick="do_a_thing"&gt;
        &lt;td&gt;
          &lt;input type="hidden" value="1" /&gt;
        &lt;/td&gt;
        &lt;td&gt;
          &lt;input type="hidden" value="1" /&gt;
        &lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr class="row" onclick="do_a_thing"&gt;
        &lt;td&gt;
          &lt;input type="hidden" value="2" /&gt;
        &lt;/td&gt;
        &lt;td&gt;
          &lt;input type="hidden" value="1" /&gt;
        &lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr class="row" onclick="do_a_thing"&gt;
        &lt;td&gt;
          &lt;input type="hidden" value="3" /&gt;
        &lt;/td&gt;
        &lt;td&gt;
          &lt;input type="hidden" value="1" /&gt;
        &lt;/td&gt;
      &lt;/tr&gt;
    &lt;/tbody&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>I currently have the following xpath to select the table row that contains the attribute where an input has value = 2:</p>
  
  <pre><code>//*table[@id='uniqueId']//tr[td[0]/value='2']
  </code></pre>
  
  <p>According to a <a href="https://stackoverflow.com/questions/9683054/xpath-to-select-element-based-on-childs-child-value">previous question</a>, this should work. Why doesn't it work here?</p>