如何使用 AND 运算创建 Jsoup 选择器?
我想在 html 中找到以下标签。
<a href="http://www.google.com/AAA" class="link">AAA</a>
我知道我可以使用 a[href^=http://www.google.com/] 或 a[class=link] 这样的选择器。 但我怎样才能将这两个条件结合起来呢?
或者有更好的方法来做到这一点吗?像正则表达式一样?又如何呢? 谢谢!
I want to find the following tag in a html.
<a href="http://www.google.com/AAA" class="link">AAA</a>
I know I can use a selector like a[href^=http://www.google.com/] or a[class=link].
But how can I combine this two conditions?
Or is there a better way to do this? Like regex? and how?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
只需将它们组合到一个 CSS 选择器中即可。
或者
考虑正则表达式对于这样一个世界级的 HTML 解析器来说是没有意义的。
Just combine them in a single CSS selector.
or
Considering regex makes no sense with such a world class HTML parser.