button1
Label1.Text = Post of the user from the html code of the site.
That what i want, that it gets the as example posts or like activity.
Originally Posted by Blubb1337
Either use RegEx or a StringBetween function.
Save the sourcecode of the page in a variable and extract the data you want to extract.
..........................
Originally Posted by Blubb1337
..........................
more informations plz
User regex to grab that information from the page's source like Blubb said!
[php]Public Function Sb(ByVal text As String, ByVal startstring As String, ByVal endstring As String) 'string between
Dim part1() As String = Split(text, startstring)
If UBound(part1) > 0 Then
Dim part2() As String = Split(part1(1), endstring)
If UBound(part2) > 0 Then
Return part2(0)
Else
Return -2
End If
Else
Return -1
End If
End Function
[/php]
Use a HttpWebRequest or a WebClient to download the HTML source into a string variable.
[php]
Private Function GetSauce(ByVal URL As String) As String
Dim pageSauce as string = String.Empty
Using wClient As New Net.WebClient With {.Encoding = System.Text.Encoding.UTF8}
pageSauce = wClient.DownloadString(URL)
End Using
Return pageSauce
End Function
[/php]
Or
[php]
Private Function GetSauce(ByVal URL As String) As String
Using sRead As New IO.StreamReader(CType(Net.WebRequest.Create(URL), Net.HttpWebRequest).GetResponse.GetResponseStream)
Return sRead.ReadToEnd
End Using
End Function
[/php]
The above is actually ugly as fuck so here's a neater one:
[php]
Private Function GetSauce(ByVal URL As String) As String
Dim WebReq As Net.HttpWebRequest = Ctype(Net.WebRequest.Create(URL), Net.HttpWebRequest)
Dim WebResp As Net.HttpWebResponse = Ctype(webReq.GetResponse, Net.HttpWebResponse)
Using sRead As New IO.StreamReader(WebResp.GetResponseStream)
Return sRead.ReadToEnd
End Using
End Function
[/php]
Now you just assign the value that is returned by "GetSauce("http://www,website.com/User=" & TextBox1.Text)" To a variable, then use string manipulation to get the values you need.
Originally Posted by Jason
Use a HttpWebRequest or a WebClient to download the HTML source into a string variable.
[php]
Private Function GetSauce(ByVal URL As String) As String
Dim pageSauce as string = String.Empty
Using wClient As New Net.WebClient With {.Encoding = System.Text.Encoding.UTF8}
pageSauce = wClient.DownloadString(URL)
End Using
Return pageSauce
End Function
[/php]
Or
[php]
Private Function GetSauce(ByVal URL As String) As String
Using sRead As New IO.StreamReader(CType(Net.WebRequest.Create(URL), Net.HttpWebRequest).GetResponse.GetResponseStream)
Return sRead.ReadToEnd
End Using
End Function
[/php]
The above is actually ugly as fuck so here's a neater one:
[php]
Private Function GetSauce(ByVal URL As String) As String
Dim WebReq As Net.HttpWebRequest = Ctype(Net.WebRequest.Create(URL), Net.HttpWebRequest)
Dim WebResp As Net.HttpWebResponse = Ctype(webReq.GetResponse, Net.HttpWebResponse)
Using sRead As New IO.StreamReader(WebResp.GetResponseStream)
Return sRead.ReadToEnd
End Using
End Function
[/php]
Now you just assign the value that is returned by "GetSauce("http://www,website.com/User=" & TextBox1.Text)" To a variable, then use string manipulation to get the values you need.
Thanks for your work, but what if my element (name) has no value ?
Theres just the element ID and no name tag.
Originally Posted by Blubb1337
[php]Public Function Sb(ByVal text As String, ByVal startstring As String, ByVal endstring As String) 'string between
Dim part1() As String = Split(text, startstring)
If UBound(part1) > 0 Then
Dim part2() As String = Split(part1(1), endstring)
If UBound(part2) > 0 Then
Return part2(0)
Else
Return -2
End If
Else
Return -1
End If
End Function
[/php]
Are you completely ignoring me?
msgbox(SB(pagesource, "<bla>","</bla>"))
Well, you can PM me with the webpage in question and I'll try see whether the problem is that you don't have the correct ID's at the moment, if that's the problem none of our solutions will help you much as they'll likely rely on you putting in the elements ID at some point.