jSoup 检查跨度类是否存在
我有一个具有以下格式的 HTML
<article class="cik" id="100">
<a class="ci" href="/abc/1001/STUFF">
<img alt="Micky Mouse" src="/images/1001.jpg" />
<span class="mick vtEnabled"></span>
</a>
<div>
<a href="/abc/1001/STUFF">Micky Mouse</a>
<span class="FP">$88.00</span> <span class="SP">$49.90</span>
</div>
</article>
在上面的代码中,文章内的标签有一个没有标签的 span class="mick vtEnabled"
。我想检查带有指定类名的跨度标签是否存在于文章标签中。我该怎么做?
我尝试了 select("> a[href] > span.mick vtEnabled")
并检查了大小..无论是否设置,所有文章标签的大小都保持为 0。有任何输入吗?
I have a HTML with the following format
<article class="cik" id="100">
<a class="ci" href="/abc/1001/STUFF">
<img alt="Micky Mouse" src="/images/1001.jpg" />
<span class="mick vtEnabled"></span>
</a>
<div>
<a href="/abc/1001/STUFF">Micky Mouse</a>
<span class="FP">$88.00</span> <span class="SP">$49.90</span>
</div>
</article>
In the above code the tag inside article has a span class="mick vtEnabled"
with no label. I want to check if this span tag with the class name specified is present within the article tag. How do I do that?
I tried select("> a[href] > span.mick vtEnabled")
and checked the size..it remains 0 for all the article tags irrespective if its set or not. Any inputs?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这
将选择具有两个类的 div。
This
selects the div with the two classes.