/    Sign up×
Community /Pin to ProfileBookmark

How I change this script?

Hi,

That code extracts image links. Don´t forget to copy and paste that code for your clipboard.?

Any suggestion to change it to extract “.html” links instead image links will be welcome!?

[QUOTE]

<html>
<head>

<script>

function extractlinks(){
if (document.all||document.getElementById){
if (document.all) {var imgs=document.all.tags(“img”)}
if (document.getElementById){var imgs=document.getElementsByTagName(“img”)}

var total=imgs.length
var win2=window.open(“”,””,”menubar,scrollbars,status”)

var txtlink1
var imgTxtLink

win2.document.write(“<h2> Total Images = “+total+”</h2><br>”)
var imgcnt=0
for (i=0;i<total;i++){

txtLink1=imgs[i]
//imgTxtLink = imgs[i].innerHTML
imgTxtLink = imgs[i].src

win2.document.write(‘<fieldset>Image (‘+ i + ‘)= …txtLink1==>’ + txtLink1 + ‘ </fieldset> ‘)
win2.document.write(‘<fieldset>Image (‘+ i + ‘)= …imgTxtLink==>’ + imgTxtLink + ‘ </fieldset> ‘)
win2.document.write(‘<fieldset>Image (‘+ i + ‘)= …IMG==>’ + imgs[i] + ‘ </fieldset><br> ‘)

}
win2.document.close()
}
}

//–>
</script>
</head>

<body>

<BUTTON onclick=”extractlinks()”; >List Page Links</BUTTON> </BODY></HTML>

[/QUOTE]

Letchev

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @lebronletchev spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 4.25,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...