Currently i am working on a web parser. Ideally i would like to parse all content from web page(including images,js-scripts etc). I`m using this little snippet of code to get html-markup of a web page
HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create("https://yandex.ru/"); myRequest.Method = "GET"; WebResponse myResponse = myRequest.GetResponse(); StreamReader sr = new StreamReader(myResponse.GetResponseStream(), System.Text.Encoding.UTF8); string result = sr.ReadToEnd(); sr.Close(); myResponse.Close();
But it does not return css,moreover if i save it to some local file on my pc(yep,russian search engine,no copyrighterino, just first thing that came to my mind as i tested it) it just does not work properly(but works just fine with stack overflow html code snippet thingy(dont know whats its proper name))
I do not understand what`s causing this problem, so i have been wondering is there any c# library that can help me with this task.