I am attempting to convert a webpage from a format I don't understand to ascii so I can look for certain data. I retrieve the data using webclient with a url of the web page and then using encoding to convert the data from what I think is unicode to ascii but the format doesn't change at all. Below is my code:
WebClient web = new WebClient();
string page = "https://www.myurl.com/";
Stream data = web.OpenRead(page);
StreamReader reader1 = new StreamReader(data);
string input = reader1.ReadToEnd();
Encoding unicode = Encoding.Unicode;
Encoding ascii = Encoding.ASCII;
string webpage = ascii.GetString(
Encoding.Convert(unicode, ascii, unicode.GetBytes(input))
);
Below is what the webpage data looks like which is the same as the input data which suggests my conversion didn't work.
\"sprited\":true,\"spriteCssClass\":\"sx_a11c08\",\"spriteMapCssClass\":\"sp_SN-oNOqlzVS\"},\"505789\":{\"sprited\":true,\"spriteCssClass\":\"sx_5219b1\",\"spriteMapCssClass\":\"sp_SN-oNOqlzVS\"},\"505782\":{\"sprited\":true,\"spriteCssClass\":\"sx_c0671f\",\"spriteMapCssClass\":\"sp_SN-oNOqlzVS\"},\"505794\":{\"sprited\":true,\"spriteCssClass\":\"sx_8cf344\",\"spriteMapCssClass\":\"sp_SN-oNOqlzVS\"},\"495429\":
Does anyone know what kind of data this is and how to convert it into data I can understand? When I show the page source of the webpage on the browser none of this weird data shows up. In other words the data I get from the webclient doesn't look at all like the page source on the browser.