Get value from HTML Table

17 views
Skip to first unread message

Hitesh

unread,
Aug 12, 2008, 7:48:03 AM8/12/08
to watij
Problem statement:

I want to ger <td> value of table above from known value.
Example:

<html>
<body>

<table id="t">
<td>H1</td>
<td>H2</td>
<td>H3</td>
</table>
</body>
</html>

I know value H2 of <td> and I want value of above that <td> ie H1. Can
we travers back in table and get value of <td>?

Thanks for your help.

johnny

unread,
Aug 13, 2008, 1:46:45 AM8/13/08
to watij
Yes that's possible, but in my case only with xpath.
Try that:

ie.cell(
FinderFactory.xpath(
"//table[@id='t']/td[child::text()='H2']/preceding-sibling::td"
)
);


On 12 Aug., 13:48, Hitesh <hiteshkumar_panch...@persistent.co.in>
wrote:
Reply all
Reply to author
Forward
0 new messages