3

I have a simple function to scrape a web page that is suddenly getting a 503 error from the following code for a specific page:

try
{
  WebClient client = new WebClient();
  client.Proxy = null;
  string webhtml = client.DownloadString(strURL);
  client.Dispose();
  return (webhtml);
}

The url works when I enter it in IE or FF but it's returning an error when this code runs. Other urls work fine. I'm guessing there is something different about the http request from .net than from either of the browsers. Is there any way to better emulate a browser-based http request?

Thanks.

nycdan
  • 2,819
  • 2
  • 21
  • 33

1 Answers1

0

Found the http headers I was looking for from this site. Very useful.

http://www.ericgiguere.com/tools/http-header-viewer.html

nycdan
  • 2,819
  • 2
  • 21
  • 33
  • Try [Fiddler](http://www.fiddler2.com/fiddler2/) out. It has all the goodness you'll ever need. – cgatian Jul 01 '11 at 08:21
  • Thanks, cgatian. I forgot about Fiddler but you're right. That would have solved my problem just as well. – nycdan Jul 16 '11 at 02:30