I am trying to search a page for certain links only, but can't seem to find a way to have it 'search' for a 'keyword' in the links, and only list those in a ListBox - What I have now works to grab ALL the links on the page, but I need to only find SPECIFIC ones:
Any help would be greatly appreciated - I spent the last hour Googling this, and no mention anywhere on how to find only certain links...Code:Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles Button1.Click WebBrowser1.Navigate(TextBox1.Text) End Sub Private Sub WebBrowser1_DocumentCompleted( _ ByVal sender As Object, _ ByVal e As WebBrowserDocumentCompletedEventArgs) _ Handles WebBrowser1.DocumentCompleted If (WebBrowser1.ReadyState = WebBrowserReadyState.Complete) Then For Each ClientControl As HtmlElement In WebBrowser1.Document.Links Debug.Print(ClientControl.GetAttribute("href")) Next End If End Sub End Class




Reply With Quote