我想将以下Xpath转换为Jsoup查询。有人可以帮忙吗?是否有工具可以做到这一点?
//*[contains(@class, 'drop-down-container') and contains(.//span, 'Kategori')]
答案 0 :(得分:0)
示例1:
[XPath]
//*[@id="docs"]/div[1]/h4/a
[JSoup]
document.select("#docs > div > h4 > a").attr("href");
示例2:
[XPath]
//*[@id="action-bar-container"]/div/div[2]/a[2]
[JSoup]
document.select("#action-bar-container > div > div:eq(1) > a:eq(1)").attr("href");