I have downloaded the HTML data from a website using webclient class. Now I want to read the data in between tags. I came to know about htmlagilitypack, but I don’t want to use it.
I am using the following code to get the HTML data.
WebClient client = new WebClient();
string url = "XXXXXXXXXXXXX"
Byte[] requestedHTML;
requestedHTML = client.DownloadData(url);
string htmlcode = client.DownloadString(url);
//client.DownloadFile(url, @"E:\test.html");
UTF8Encoding objUTF8 = new UTF8Encoding();
string html = objUTF8.GetString(requestedHTML);
Response.Write(html);
Try This:
The string value will give you the value = “Chicago”