Hi All, I am trying to get the TAGS from a website using Httpwebrequest, even tho I got some help from an amazing friend, yet I kee failing. I on day 3 now and I am exhausted... I really hope I could get some hand with this, Thank you Very much in advance..
Below is the HTML WebPage Code that I was talking about, I need the Tags in Red Color into a ListBox or ListView.
So far I have tried everything, and below is my httpwebrequet code:
Cant wait to get a response..... Thanks a lot
Below is the HTML WebPage Code that I was talking about, I need the Tags in Red Color into a ListBox or ListView.
Code:
<div CLASS="sidebar_head">Favorit Tags</div>
<div CLASS="sidebar_comments"> <A HREF="http://www.searchmusic.com/tags/12/?search=tag&tag=All Kinds of Music">All Kinds of Music</A>
<A HREF="http://www.SITE.com/tags/12/?search=tag&tag=HipHop">HipHop</A>
<A HREF="http://www.SITE.com/tags/12/?search=tag&tag=EUROPE and US Charts">EUROPE and US Charts</A>
<A HREF="http://www.SITE.com/tags/12/?search=tag&tag=Rap">Rap</A>
<A HREF="http://www.SITE.com/tags/12/?search=tag&tag=Rock">Rock</A>
</div>
PHP Code:
Private Sub GetTags(ByVal Username As String)
Try
Dim Webreq As HttpWebRequest = HttpWebRequest.Create("http://www.Site.com")
Using Webres As HttpWebResponse = Webreq.GetResponse
Using Reader As New StreamReader(Webres.GetResponseStream)
Using Rich As New RichTextBox With {.Text = Reader.ReadToEnd}
For i As Integer = 0 To Rich.Lines.Count - 1
Dim line As String = Rich.Lines(i)
If line.Contains("<div CLASS=" & Chr(34) & "sidebar_comments" & Chr(34)) Then
Dim Num As Integer = 3
Do Until Rich.Lines(i + Num).Contains("</A>")
ListView1.Items.Add(GetBetween(Rich.Lines(i + Num), "</A>", Chr(34), 1))
Num += 1
Loop
Exit Sub
End If
Next
End Using
End Using
End Using
Catch ex As Exception
ListView1.Items.Add("None!")
End Try
End Sub