Skip to content

Instantly share code, notes, and snippets.

@kandebonfim
Created July 28, 2016 13:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kandebonfim/43a7714d98772fd4991ccf41ad7de545 to your computer and use it in GitHub Desktop.
Save kandebonfim/43a7714d98772fd4991ccf41ad7de545 to your computer and use it in GitHub Desktop.
Search for links containing an specific string in a webpage
var str = 'www.maybeyourwebsite.here'
document.querySelectorAll('a').forEach(function(e) {
if (e.href.indexOf(str) > 0) {
console.log(e.href)
};
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment