mikedopp.net

doppNet
posts - 56, comments - 8, trackbacks - 1

Screen scraping ASP.NET

Here is a little fun with screen scraping.

Source:

   1:  HttpWebResponse response;
   2:   
   3:  WebProxy proxy = new WebProxy(proxyaddress);
   4:   
   5:  proxy.Credentials = new NetworkCredential("username","password");
   6:   
   7:  HttpWebRequest request = (HttpWebRequest)System.Net.HttpWebRequest.Create(url);
   8:   
   9:  request.Proxy = proxy;
  10:   
  11:  response = (HttpWebResponse)request.GetResponse();
  12:   
  13:  using (StreamReader sr = new StreamReader(response.GetResponseStream()) )
  14:   
  15:  {
  16:   
  17:  result = sr.ReadToEnd();
  18:   
  19:  // Close and clean up the StreamReader
  20:   
  21:  sr.Close();
  22:   
  23:  }

Print | posted on Monday, July 23, 2007 4:48 PM |

Feedback

No comments posted yet.

Post Comment

Title  
Name  
Email
Url
Comment   
Please add 3 and 6 and type the answer here:

Powered by: