Keith R. Pinster
2007-11-16 18:25:00 UTC
I am instantiating a WebClient to scrap a web site. Here's my code:
string myURL = "http://www.bloomberg.com/markets/rates/index.html";
WebClient client = new WebClient();
string strPageData = client.DownloadString(myURL );
or
string strPageData = Encoding.ASCII.GetString(client.DownloadData(myURL));
or
HttpWebRequest webreq = (HttpWebRequest)WebRequest.Create(myURL );
webreq.MaximumAutomaticRedirections = 300;
HttpWebResponse webresp = (HttpWebResponse)webreq.GetResponse();
The problem is that when I hit the site, it throws this error:
"Too many automatic redirections were attempted."
Has anyone ever encountered something like this? I can't believe that
the site is redirecting me over 300 times. When you go to the site,
it does some things, but it loads pretty quickly, so there can't be
that many redirects. It was working up until yesterday and then all
of a sudden I get this error. Any thoughts?
string myURL = "http://www.bloomberg.com/markets/rates/index.html";
WebClient client = new WebClient();
string strPageData = client.DownloadString(myURL );
or
string strPageData = Encoding.ASCII.GetString(client.DownloadData(myURL));
or
HttpWebRequest webreq = (HttpWebRequest)WebRequest.Create(myURL );
webreq.MaximumAutomaticRedirections = 300;
HttpWebResponse webresp = (HttpWebResponse)webreq.GetResponse();
The problem is that when I hit the site, it throws this error:
"Too many automatic redirections were attempted."
Has anyone ever encountered something like this? I can't believe that
the site is redirecting me over 300 times. When you go to the site,
it does some things, but it loads pretty quickly, so there can't be
that many redirects. It was working up until yesterday and then all
of a sudden I get this error. Any thoughts?