为什么不尝试检测网络浏览器中的元素类型:
代码片段最初来自@ElektroStudios,我只是一个不署名粘贴代码的笨蛋。
Dim Document As HtmlDocument
Private Sub WebBrowser_DocumentCompleted(ByVal sender As System.Object, ByVal e As WebBrowserDocumentCompletedEventArgs) _
Handles WebBrowser1.DocumentCompleted
Document = sender.Document
AddHandler document.Click, New HtmlElementEventHandler(AddressOf Document_Click)
End Sub
Private Sub Document_Click(ByVal sender As Object, ByVal e As HtmlElementEventArgs)
Select Case Document.ActiveElement.TagName.ToLower
Case "button" : MsgBox("You've clicked a button")
Case "input" : MsgBox("You've clicked a input")
Case "a" : MsgBox("You've clicked a link")
Case Else
End Select
End Sub
稍后你可以用MsgBox("You've clicked a link")
一些函数或事件或子替换并做你想做的事..:D