Created
April 5, 2020 19:08
-
-
Save ujeenator/7ba87c07f491076d5f27a699a57d7a67 to your computer and use it in GitHub Desktop.
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 $$x (selector) { | |
const xpathResult = document.evaluate(selector, document, null, XPathResult.ANY_TYPE, null) | |
const resultArray = [] | |
while (true) { | |
const item = xpathResult.iterateNext() | |
if (item) { | |
resultArray.push(item) | |
} else { | |
break | |
} | |
} | |
return resultArray | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment