Last active
January 26, 2020 23:17
-
-
Save jaywon/5a760f0d6b62001ef2c56a95f9142e13 to your computer and use it in GitHub Desktop.
Hurricane Electric ASN Extraction Snippet
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
/** | |
Usage: | |
1. Browse to https://bgp.he.net/ | |
2. Search for company name ie. Acmecorp | |
3. On search results page, copy this snippet into Developer Console for an easily copy/paste(able) list of IP ranges w/ new line separators | |
**/ | |
let links = document.getElementsByTagName('a'); | |
let asnExtractList = ""; | |
for (let i = 0; i < links.length; i++){ | |
if(links[i].href.indexOf('/net/') > 0){ | |
asnExtractList += links[i].innerText + '\n'; | |
} | |
} | |
console.log(asnExtractList) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment