I'm using a c# program to extract to a string the following page:
and I'm using the following code:
urlItem = "http://signssafety.com/signsafety/ProductDescription.aspx?productID=7"
HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(urlItem);
request.UserAgent = "Foo";
request.ContentType = "text/html; charset=UTF-8";
Encoding wind1252 = Encoding.GetEncoding(1252);
request.UseDefaultCredentials = true;
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
StreamReader myStreamReader = new streamReader(response.GetResponseStream(), wind1252);
string responseString = myStreamReader.ReadToEnd();
StreamWriter swwrite = new StreamWriter(@"Items.html");
When I view the downloaded Items.html file I see that the the actual page that was downloaded was:
and not the page in the link above.
I want to continue using the c# console program, and don't want to use the WebBrowser object. Does anyone know what I'm doing wrong or what can be done using the C# console to download the actual page?