Skip to content

Instantly share code, notes, and snippets.

@KempfCreative
Created March 27, 2020 14:52
Show Gist options
  • Save KempfCreative/125cf0c955dde3557ea778d53db82c59 to your computer and use it in GitHub Desktop.
Save KempfCreative/125cf0c955dde3557ea778d53db82c59 to your computer and use it in GitHub Desktop.
Query for FB Marketplace items
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