|
-
May 11th, 2009, 09:45 PM
#1
Thread Starter
Junior Member
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
-
May 12th, 2009, 12:56 AM
#2
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
Please mark you thread resolved using the Thread Tools as shown
-
May 12th, 2009, 01:00 AM
#3
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)
Last edited by ForumAccount; May 12th, 2009 at 01:04 AM.
-
May 13th, 2009, 02:35 PM
#4
Thread Starter
Junior Member
Re: Extract text from html source
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|