简体   繁体   English

Jsoup不显示文本

[英]Jsoup not showing text

So i have been working on this for 2 hours now did some searching about jsoup sounded pretty cool so i got in to it! 因此,我已经为此工作了2个小时,现在做了一些有关jsoup的搜索听起来很酷,所以我开始研究它!

Am facing this problem now with trying to get the text of this span: 现在正尝试获取此跨度的文本来面对此问题:

<span class="badge points2">7,800P</span>

I tried using this code to get: 7,800P 我尝试使用此代码获得:7,800P

 String points_test = alert_second.select("span[class=badge points2]").text();

What am i doing wrong? 我究竟做错了什么?

Any fix or help is great 任何修复或帮助都很棒

Thanks to all who try to help and for those who tried there best! 感谢所有尝试提供帮助的人,以及那些在其中做得最好的人!

Jsoup documentation provide the following example: Jsoup文档提供以下示例:

.class  elements with a class name of "class"

So try something like: 因此,尝试类似:

String points_test = alert_second.select("span.badge.points2").text();

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM