Last active
February 26, 2019 15:44
-
-
Save PatelUtkarsh/508fefc0d6502085f04982d28b1a37ef to your computer and use it in GitHub Desktop.
Get all hostname from homepage <a>
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
var anchors = document.querySelectorAll('a'); | |
var hosts = new Set(); | |
anchors.forEach((anch) => { | |
hosts.add(anch.hostname); | |
}); | |
console.table(Array.from(hosts)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment