I\'m using the document.evaluate() JavaScript method to get an element pointed to by an XPath expression:
document.evaluate()
var element = document.evaluate( pat
Try this:
function getListOfElementsByXPath(xpath) { var result = document.evaluate(xpath, document, null, XPathResult.ANY_TYPE, null); return result; }
Then call it:
var results = getListOfElementsByXPath("//YOUR_XPATH"); while (node = results.iterateNext()) { console.log(node); }