Created
September 30, 2020 16:41
-
-
Save jpaugh/a07b369e41c7ba03e8a729c8cb8cc122 to your computer and use it in GitHub Desktop.
How to test XPath in the browser
This file contains hidden or 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
function iterate(i) { | |
var result = []; | |
do { | |
var next = i.iterateNext(); | |
result[result.length] = next; | |
} while (next != null) | |
return result; | |
} | |
iterate(document.evaluate("//a[@href and data-mediatype]", document, null, XPathResult.ANY_TYPE)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment