Created
October 26, 2023 14:38
-
-
Save elotroalex/a1368beabd28c24f67ffb1e823e0079f to your computer and use it in GitHub Desktop.
Get a list of URLs from a page
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
console.log([...new Set([...document.querySelectorAll('a')].filter(a=>a.href.match('pdf')).map(a=>a.href.replace(/\/[^\/]+\.pdf.*$/,'')))].join('\n')) | |
console.log([...new Set([...document.querySelectorAll('a')].filter(a=>a.href.match('155-publications')).map(a=>a.href.replace(/155\-publications.*$/,'155-publications')))].join('\n')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment