开发者

How i can find a elements with tag table in a html page

开发者 https://www.devze.com 2023-04-01 11:49 出处:网络
I have the html page, and me need find some elements with tag a \'table\', but such tables maybe more than one, and they don\'t have id or class name.

I have the html page, and me need find some elements with tag a 'table', but such tables maybe more than one, and they don't have id or class name. Example:

<table>
<tbod开发者_开发技巧y>
<tr>
.....

<table>
<tbody>
<tr>
.....

<table>
<tbody> 
<tr>    <-------BINGO! 
.....

How i can it's do with help HtmlUnit? Thanks...


Use HtmlPage.getElementsByTagName("table") and iterate over the returned list of HtmlTable objects until you find the table you want to find.

0

精彩评论

暂无评论...
验证码 换一张
取 消