I need to extract links from a given page to be displayed in a new window, however, the particular page im wanting to extract links from, I dont have direct access to that pages html.
this below code extracts all links on any page its on.....
<script language="JavaScript1.2">
<!--
/*
Link Extractor Script-
*/
function extractlinks(){
var links=document.all.tags("A")
var total=links.length
var win2=window.open("","","menubar,scrollbars")
win2.document.write("<h2>Total Links="+total+"</h2><br>")
for (i=0;i<total-1;i++){
win2.document.write(links[i].outerHTML+"<br>")
}
}
//-->
</script>
<button onClick="extractlinks()">Extract Links</button>
......but could it be altered to extract from a given page via http://, even though its not on that page? im thinking something like
<center><script language="JavaScript1.2">
<!--
/*
Link Extractor Script-
*/
function extractlinks(){
var links=document.all.http://("http://www.google.com")
var total=links.length
var win2=window.open("","","menubar,scrollbars")
win2.document.write("<h2>Total Links="+total+"</h2><br>")
for (i=0;i<total-1;i++){
win2.document.write(links[i].outerHTML+"<br>")
}
}
//-->
</script>
<button onClick="extractlinks()">Extract Links</button></center>
can javascript do that?