get all the href attributes of a web site [duplicate]
You can use document.links to get the anchors, then just loop through grabbing the href, like this: var arr = [], l = document.links; for(var i=0; i<l.length; i++) { arr.push(l[i].href); } //arr is now an array of all the href attributes from the anchors in the page You can test it out here, you could … Read more