Scrren Scraping Error: 501 Not Implemented

A

aferriere

Hi

I am getting a System.Net.WebException -- >The remote server returned
an error: (501) Not Implemented
when I try to read the contents from http://www.ourcommunity.com.au/
member/directory_details.do?orgId=319
Other urls which I have tried work fine.

I have tried using both WebRequest and WebClient

*****CODE USING WebRequest*******
string result;
WebResponse objResponse;
WebRequest objRequest = System.Net.HttpWebRequest.Create(url);
objRequest.Proxy=WebProxy.GetDefaultProxy(); //*** THROWS THE
System.Net.WebException
objResponse = objRequest.GetResponse();
using (StreamReader sr = new
StreamReader(objResponse.GetResponseStream()) )
{
result = sr.ReadToEnd();
// Close and clean up the StreamReader
sr.Close();
}


*****CODE USING WebClient*******
WebClient objWebClient = new WebClient();
byte[] aRequestedHTML;
aRequestedHTML = objWebClient.DownloadData(url); //*** THROWS THE
System.Net.WebException
UTF8Encoding objUTF8 = new UTF8Encoding();
string strRequestedHTML;
strRequestedHTML = objUTF8.GetString(aRequestedHTML);
result = strRequestedHTML;

Pretty much stuck here and not sure if there is any other way to get
the page content. Anyone knows of how I could bet the content from
http://www.ourcommunity.com.au/member/directory_details.do?orgId=319
Any help would be greatly appreciated
 
A

Alvin Bruney [MVP]

--
Regards,
Alvin Bruney
------------------------------------------------------
Shameless author plug
Excel Services for .NET is coming...
OWC Black book on Amazon and
www.lulu.com/owc
Professional VSTO 2005 - Wrox/Wiley
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top