Rbx.trade/s/ is a site where you can look up a user. I iterate through a list of users placing one username in the search box at a time . Right now my program launches a new browser to see the users stats. I would like to show their stats in my program without opening a browser. Ive tried to read the page into a string but my info was not listed. I would like the RAP value displayed in textbox4. how do I do this?
Private Sub Scrape()
Try
Dim strURL As String = "http://rbx.trade/s/" + TextBox1.Text
Dim strOutput As String = ""
Dim wrResponse As WebResponse
Dim wrRequest As WebRequest = HttpWebRequest.Create(strURL)
TextBox5.Text = "Extracting..." & Environment.NewLine
wrResponse = wrRequest.GetResponse()
Using sr As New StreamReader(wrResponse.GetResponseStream())
strOutput = sr.ReadToEnd()
' Close and clean up the StreamReader
sr.Close()
End Using
TextBox5.Text = strOutput
'Formatting Techniques
' Remove Doctype ( HTML 5 )
strOutput = Regex.Replace(strOutput, "<!(.|\s)*?>", "")
' Remove HTML Tags
strOutput = Regex.Replace(strOutput, "</?[a-z][a-z0-9]*[^<>]*>", "")
' Remove HTML Comments
strOutput = Regex.Replace(strOutput, "<!--(.|\s)*?-->", "")
' Remove Script Tags
strOutput = Regex.Replace(strOutput, "<script.*?</script>", "", RegexOptions.Singleline Or RegexOptions.IgnoreCase)
' Remove Stylesheets
strOutput = Regex.Replace(strOutput, "<style.*?</style>", "", RegexOptions.Singleline Or RegexOptions.IgnoreCase)
TextBox4.Text = (strOutput) 'write Formatted Output To Separate TB
Catch ex As Exception
Console.WriteLine(ex.Message, "Error")
End Try
End Sub
Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click
Scrape() 'Scrape Text From URL
End Sub
This returns some text but not the value I seek