Created
March 27, 2020 14:52
-
-
Save KempfCreative/125cf0c955dde3557ea778d53db82c59 to your computer and use it in GitHub Desktop.
Query for FB Marketplace items
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
Array.from(document.getElementsByTagName('a')).filter((anchor) => { | |
let uri; | |
try { | |
uri = new URL(anchor.href); | |
} catch(e) { | |
return null; | |
} | |
return /^\/marketplace\/item/.test(uri.pathname); | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment