gpt4 book ai didi

jsoup - JSOUP select() 方法的 OR 运算符

转载 作者:行者123 更新时间:2023-12-03 20:36:22 27 4
gpt4 key购买 nike

我试图找到所有 <div class="name1"><div class="name2">一页/文档中的标签。

我如何使用 OR运算符(operator)在 doc.select("div.name1 OR div.name2") ?

最佳答案

select method of JSoup或多或少地实现了 CSS 选择器语法。因此,您可以非常简单地使用 CSS 指定替代方案的方式,即使用 , .这应该有效:

doc.select("div.name1,div.name2");

关于jsoup - JSOUP select() 方法的 OR 运算符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24485013/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com