tr[1]
の数字部分が違う、こういうxpathでの指定を、まとめて一つで行いたいのですが、
document.evaluate('//*[@id="currencies-all"]/tbody/tr[1]/td[2]/a/text()', document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue; document.evaluate('//*[@id="currencies-all"]/tbody/tr[2]/td[2]/a/text()', document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue; document.evaluate('//*[@id="currencies-all"]/tbody/tr[3]/td[2]/a/text()', document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
こういう感じでやってみてもだめだったのですが、
document.evaluate('//*[@id="currencies-all"]/tbody/tr[*]/td[2]/a/text()', document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
どうしたら良いでしょうか。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。