我有一个带有名为的表 ID 的 HTML 文件:results-table
。我想要的只是在我的循环搜索中识别表格。我至少有一个关于如何使用 className 识别表的示例。
查找具有 ClassName 的表的示例:
For Each table In HTMLDoc.getElementsByTagName("TABLE")
If table.className = "results-table" Then
tablestr = table.outerHTML
End If
Next
在这种情况下,我怎样才能使用表 ID 找到表?