Hi I have a question regarding how to go to a website and scan it for hyperlinks and save them in a variable. I want to do something like this

  Var everythingAdiffrentPageContains = //Go to some link exwww.msn.se and store it in this variable

   var pageLinks  = []; 
 var anchors    = everythingAdiffrentPageContains.getElementsByTagName('a');  
    var numAnchors = anchors.length;
    for(var i = 0; i < numAnchors; i++) {     
In other words I would like to go to some site and store all that sites Hyperlinks in an array, how would you do this in javascript?

Im not trying to connect to another domain. Im trying to connect to another apache webserver inside my lan that hosts a website that I would like to scan for links.