Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27333

HtmlElementCollection Sort Links

$
0
0
Code:

     
        Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        Dim PageElements As HtmlElementCollection = WebBrowser1.Document.GetElementsByTagName("a")

        For Each CurElement As HtmlElement In PageElements
            TextBox3.Text = TextBox3.Text & CurElement.GetAttribute("href") & Environment.NewLine
        Next
    End Sub

so this pulls all links from a webpage and puts them into a textbox what I need is a way to sort the links so that only the links that are like this are left

Code:

http://likenation.com/p.php?p=youtube&vid=1217
http://likenation.com/p.php?p=youtube&vid=1216
http://likenation.com/p.php?p=youtube&vid=1188
http://likenation.com/p.php?p=youtube&vid=953

Also I couldn't figure out how to put what I put into a textbox into a Array so if someone want to show me how to do that too that be great ^^
if any ideas please post thanks in advance

Viewing all articles
Browse latest Browse all 27333

Trending Articles