Extract text from html source
i am trying to extract some usernames from a website. normally i dont have a problem and but cant get it to work...here is the code i normally use
For Each temp As HtmlElement In WebBrowser1.Document.Links
Dim str As String = Nothing
str = temp.GetAttribute("href")
If str.Contains("profile") Then
Dim x() As String
x = str.Split("=")
ListBox1.Items.Add(x(1))
End If
str = Nothing
Next
but this is the html code i want to get from
<a href="http://help.com/?status=@astradamasta%20&in_reply_to_status
how would i go about getting the user which is astradamasta
thanks in advance
Re: Extract text from html source
The best thing is you can go for is RegularExpression.. But you have to more brief about the input data
Re: Extract text from html source
When asking things like this it's always good to say what is going to be consistent in the text you are extracting. Will it always be "<a href="http://help.com/?status=@thename%20&in_reply_to_status"? If so, and you want to use your string splitting you could do this:
vb.net Code:
Dim str As String = "<a href=""http://help.com/?status=@astradamasta%20&in_reply_to_status".Split("@"c, "%"c)(1)
Re: Extract text from html source