You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
366 B
16 lines
366 B
exports = function(xpath) {
|
|
var ret = [];
|
|
var nodesSnapshot = document.evaluate(
|
|
xpath,
|
|
document,
|
|
null,
|
|
XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,
|
|
null
|
|
);
|
|
for (var i = 0; i < nodesSnapshot.snapshotLength; i++) {
|
|
ret.push(nodesSnapshot.snapshotItem(i));
|
|
}
|
|
return ret;
|
|
};
|
|
|
|
module.exports = exports;
|
|
|