Polas5
Member
VB.NET:
Private Sub WebBrowser1_DocumentCompleted(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
Dim htmlele As HtmlElementCollection
htmlele = WebBrowser1.Document.GetElementsByTagName("h3")
For Each htm As HtmlElement In htmlele
Dim chld As HtmlElementCollection = htm.GetElementsByTagName("a")
For Each ch As HtmlElement In chld
RichTextBox1.AppendText(ch.GetAttribute("href") & vbCrLf)
If Not ch.GetAttribute("href").Contains("google") And ch.GetAttribute("href").Contains("http") Then
RichTextBox1.AppendText(ch.GetAttribute("href") & vbCrLf)
End If
Next
Next
End Sub
I have try not to add google cache pages using this method but no lucky.
VB.NET:
For Each ch As HtmlElement In chld
RichTextBox1.AppendText(ch.GetAttribute("href") & vbCrLf)
If Not ch.GetAttribute("href").Contains("google") And ch.GetAttribute("href").Contains("http") Then
RichTextBox1.AppendText(ch.GetAttribute("href") & vbCrLf)
End If
Next
Next
I hope someone will know that how to fix this small problem.
Thanks.