Possible Duplicate:
How can I download HTML source in C#
I want the source HTML of the webpage so I can parse it in my C# program.
Possible Duplicate:
How can I download HTML source in C#
I want the source HTML of the webpage so I can parse it in my C# program.
Hi,
You can use the .net HttpWebRequest
and HttpWebResponse
to do this. See the example code below.
HttpWebRequest request = (HttpWebRequest)WebRequest.Create("url");
request.Timeout = 5000;
using (WebResponse response = (HttpWebResponse)request.GetResponse())
{
Stream responeStream = response.GetResponseStream();
//do something with the response stream
}
Enjoy!