So for Personal Training I am trying to create a Highscore lookup for a game. My current code is:
HttpWebRequest httpWebRequest = (HttpWebRequest)WebRequest.Create("http://services.runescape.com/m=hiscore/a=13/compare?user1=" + textBox1.Text);
httpWebRequest.Host = "services.runescape.com";
httpWebRequest.Method = "POST";
httpWebRequest.CookieContainer = cookie;
httpWebRequest.Referer = "Referer: http://services.runescape.com/m=hiscore/a=13/ranking";
httpWebRequest.Accept = "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8";
httpWebRequest.ContentType = "application/x-www-form-urlencoded";
httpWebRequest.UserAgent = "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.143 Safari/537.36";
httpWebRequest.ContentLength = (long)bytes.Length;
httpWebRequest.Headers.Add("Origin", "services.runescape.com");
httpWebRequest.Headers.Add("Cache-Control", "max-age=0");
httpWebRequest.Headers.Add("Upgrade-Insecure-Requests", "1");
Stream requestStream = httpWebRequest.GetRequestStream();
requestStream.Write(bytes, 0, bytes.Length);
requestStream.Close();
HttpWebResponse httpWebResponse = (HttpWebResponse)httpWebRequest.GetResponse();
cookie.Add(httpWebResponse.Cookies);
StreamReader streamReader = new StreamReader(httpWebResponse.GetResponseStream());
string text = streamReader.ReadToEnd();
streamReader.Close();
httpWebResponse.Close();
I am trying to get the integer of the skill. A line in the response that holds the skill level looks like the following:
<td class="playerWinLeft alignleft"><div class="relative">a href="services.runescape.com/m=hiscore/a=13/ranking?category_type=0&table=0&page=1">2,715/a></div></td>
The 2,715 is the part that I want to log.