var keyword = '火影忍者.S02' var elements = document.evaluate("//a[contains(text(), '" + keyword + "')]/ancestor::tr[1]/td[1]/label/span", document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null); for (var i = 0; i < elements.snapshotLength; i++) { elements.snapshotItem(i).click(); }
|