Here is some code,to request html-code from url.
var currentUrl = "https://www.google.com";
HttpClient client = new HttpClient();
System.Diagnostics.Process.Start(currentUrl); //here i open a browser with same URL,
var response = await client.GetAsync(currentUrl);
string sourse = null;
if (response != null && response.StatusCode == HttpStatusCode.OK)
{
sourse =await response.Content.ReadAsStringAsync(); // here i get the html-code
}
SO, the questions is: why html code that i get from program,and html code from real page in browser i have opened few secods before are different? It doesn't make sence.
Also, here is some proofs. First image - number of character in browser-html code
I gave the simplest evidence, to make the question more easier. But if I dig deeper, the html code comes from nowhere. When I parse a specific page, and it should be 39 products, the program returns the html code, which only 6 products (which, incidentally, are not included in the 39 those that are actually on the page in the browser). So I asked the question so simply. Really,i make a new project a minute ago with this code, and it work incorrect as I wrote above. to get the code that the program returns, I can look it up in the sourse variable or leave it in a file, and then compare. Like:
FileStream fs = new FileStream("report.txt", FileMode.OpenOrCreate);
StreamWriter SW = new StreamWriter(fs);
SW.WriteLine(sourse);