Created
April 8, 2020 01:48
-
-
Save glens/1df4eff8e77dfd0e97d6efd92033344f to your computer and use it in GitHub Desktop.
javascript to extract all link urls in page for easy copy+paste
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//to extract all link urls in the page | |
//paste into javascript console | |
var links = document.getElementsByTagName('a') | |
var allurls = links.length + ' links: <br>' | |
for (link in links) { | |
console.log(links[link].href); | |
var downlink = links[link].href | |
if (typeof(downlink) != 'undefined') { | |
allurls = allurls + links[link].href + '<br>' | |
} | |
} | |
document.write(allurls) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment