我如何在 html 页面中找到带有标签表的元素
我有 html 页面,我需要找到一些带有“table”标签的元素,但这样的表可能不止一个,而且它们没有 id 或类名。 示例:
<table>
<tbody>
<tr>
.....
<table>
<tbody>
<tr>
.....
<table>
<tbody>
<tr> <-------BINGO!
.....
我如何使用 HtmlUnit 的帮助来做到这一点? 谢谢...
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>
<tbody>
<tr>
.....
<table>
<tbody>
<tr>
.....
<table>
<tbody>
<tr> <-------BINGO!
.....
How i can it's do with help HtmlUnit?
Thanks...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用
HtmlPage .getElementsByTagName("table")
并迭代返回的 HtmlTable 对象列表,直到找到要查找的表。Use
HtmlPage.getElementsByTagName("table")
and iterate over the returned list of HtmlTable objects until you find the table you want to find.