Last active
August 29, 2015 14:26
-
-
Save leotm/542f3090645e257f76ca to your computer and use it in GitHub Desktop.
Get all links from website
This file contains hidden or 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
var links = []; | |
// Replace .ext with desired filetype | |
Array.prototype.map.call(document.querySelectorAll("a[href$=\".ext\"]"), | |
function(e, i) { | |
if ((links || []).indexOf(e.href) == -1) { links.push(e.href); } | |
}); | |
console.log(links.join(" ")); | |
// Optionally copy result to clipboard | |
// Run wget <paste> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment