Skip to content

Instantly share code, notes, and snippets.

@mfyz
Created December 23, 2019 21:36
Show Gist options
  • Save mfyz/49632cbb08a0ceccb34aea5fcff40227 to your computer and use it in GitHub Desktop.
Save mfyz/49632cbb08a0ceccb34aea5fcff40227 to your computer and use it in GitHub Desktop.
evaluate xpath on browser/dom (console)
var xpath = "//a[contains(@href,'/slack') and contains(text(), 'Skip for now')]"
var result = document.evaluate(xpath, document, null, XPathResult.ANY_TYPE, null);
result.iterateNext()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment