Pages

Thursday, March 10, 2011

Read webpage using HttpWebRequest in asp.net screen scraping

HttpWebRequest req = (HttpWebRequest)WebRequest.Create("http://yahoo.com/");
HttpWebResponse res = (HttpWebResponse)req.GetResponse();
StreamReader s = new StreamReader(res.GetResponseStream(), Encoding.ASCII);
string str = s.ReadToEnd();

No comments:

Post a Comment