This is a javascript funciton to run from Safari

set dsiplaylink to "
thelinks = document.getElementsByTagName(\"a\")
newwin = window.open(\"\")
newwin.document.open()
for (i=0; i< thelinks.length; i++) 
  newwin.document.write(\"

\" + thelinks[i].href + \"
\" + thelinks[i].innerHTML + \"

\")

" set returnlinks to " var thelinks = document.getElementsByTagName(\"a\") var linktext = \"\" for (i=0; i< thelinks.length; i++) linktext = linktext + thelinks[i].href + \"\\t\" + thelinks[i].innerHTML + \"\\n\" return linktext "

tell application "Safari" do JavaScript returnlinks in document 1 end tell