I use Htmlunit in java. I need to find an element by text(), and i need the second cousin of this element (i think).
I tried this:
HtmlElement element = page.getFirstByXPath("//*[text() = \"SOMETHING\"]/parent/following-sibling/child");
System.out.println(element.asText()); // it's null
Update: The html source page:
<tr>
<script>
_l('its not important')
</script>
<td valign="top">
<font class="its not important">
</td>
<td valign="top">
<font class="its not important">
SOMETHING
<script>
_l('its not important')
</script>
</font>
<script>
_l('its not important')
</script>
</td>
</tr>
<tr>
<td></td>
<td valign="top">
THE INFORMATION I NEED
</td>
</tr>