我如何在 html 页面中找到带有标签表的元素

发布于 2024-12-02 20:28:16 字数 335 浏览 4 评论 0原文

我有 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

十二 2024-12-09 20:28:16

使用 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文