Skip to content

Instantly share code, notes, and snippets.

@EeroHeroHeino
Last active November 2, 2015 20:34
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 EeroHeroHeino/4cecc5dcf407af10b7a9 to your computer and use it in GitHub Desktop.
Save EeroHeroHeino/4cecc5dcf407af10b7a9 to your computer and use it in GitHub Desktop.
// Clicking link with the text "Click link"
var links = [].filter.call(document.querySelectorAll("a"), el => el.textContent.indexOf("Click Link") === 0);
if (links.length == 0) {
return callback(new Error("No link found"));
}
links[0].click()
callback(true);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment