XMLHTTPClass does not always retrieves remote URL data - some sites work - some Don't is there a better way to scrape?

Hi

This works using one remote URL
Http://www.sembel.net

but not a second one www.cnn.com
Will not work with a call to cnn - here's the response.

Not Found The requested URL / was not found on this server.</p>\n<hr />\n<address>Apache Server at www.cnn.com Port 80</address>\n</body></html>\n"

IS there a better way?

CODE--

string postData = "";
string uriString = "http://www.cnn.com";
string strXML ;

XMLHTTPClass xmlHTTP = new XMLHTTPClass();

xmlHTTP.open("POST", uriString,false,null,null) ;
xmlHTTP.send(postData) ;

while(xmlHTTP.readyState != 4)
      {
      }
                  
strXML = (string)xmlHTTP.responseText;

Code--
paygoAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

GwynforWebCommented:
Use this in client side JS

<body onload="init()">
<input value="view Yahoo" type="button" onclick="alert(document.getElementById('yahoo').innerHTML)">
<input value="view ebay"type="button" onclick="alert(document.getElementById('ebay').innerHTML)"> <p>
<script>
function LoadPage(theURL,theID){
   var objSrvHTTP;
    try{
          objSrvHTTP = new ActiveXObject("Msxml2.XMLHTTP.4.0");
         
     }
     catch(e){    
          try{
               objSrvHTTP = new ActiveXObject("Msxml2.XMLHTTP");
          }
               
          catch(e){
               try{              
                    objSrvHTTP = new ActiveXObject("Microsoft.XMLHTTP");
                    alert("ok you have Microsoft.XMLHTTP")
               }                  
               catch(e){              
                    alert("you need install MSXML 4.0, http://www.microsoft.com/downloads/");
                    return;
               }    
          }
     }
       objSrvHTTP.open ("GET",theURL,false);
       objSrvHTTP.send ("");
       document.getElementById(theID).innerHTML=objSrvHTTP.responseText;
}

function init(){
     LoadPage("http://www.yahoo.com","yahoo")
     LoadPage("http://www.ebay.com","ebay")
}
</script>
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
GwynforWebCommented:
thanks for the points
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.