Created
February 9, 2024 15:31
-
-
Save softplus/4478287922aec52976a3d9e720a398b1 to your computer and use it in GitHub Desktop.
Extract all unique links from the current page using Chrome Devtools
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
// JavaScript, of course | |
const urls = [...new Set($$('a').map((x) => x.href))] | |
// for non-Devtools usage (extension, etc), use document.getElementsByTagName('a') instead of $$('a') | |
// ... and spread them into an array: | |
const urls = [...new Set([...document.getElementsByTagName('a')].map((x) => x.href))] | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment