【发布时间】:2016-09-06 06:38:16
【问题描述】:
我正在尝试在第 1 列中查找字符串并自动单击第 3 列中的“详细信息”..
|-----------------------------------------|
| Column 1 | Column 2 | Column 3 |
|-----------------------------------------|
| David | 12345 | detail |
| Jhon | 67890 | detail |
| Ester | 67890 | detail |
直到最近我才能使用此代码找到第 1 列中的单词:
Dim tables As HtmlElementCollection = Me.WebBrowser.Document.GetElementsByTagName("table")
For Each tbl As HtmlElement In tables
For Each row As HtmlElement In tbl.All
For Each cell As HtmlElement In row.All
If Not cell.Style Is Nothing Then
If cell.InnerText.Contains("Jhon") Then
cell.InvokeMember("click") '---Not working because "Jhon" is not Hyperlink.
End If
End If
Next
Next
Next
现在我必须想办法点击第 3 列中的单词 detail.. 这可能吗?
【问题讨论】:
标签: vb.net winforms webbrowser-control