如果html文档中存在“电影简介”类,我想要一个笑脸。
我尝试过像“”这样的简单文本,但是当我输入一个类名时,它仍然给出了:(尽管这个类确实存在。
下面是我目前正在使用的代码
if(htmlDoc.text().contains("film-profile")) {
System.out.println(":)");
} else {
System.out.println(":(");
}提前谢谢你!
发布于 2013-11-03 18:09:46
尝试:
if(Jsoup.connect("yourURL").get().select(".film-profile").size()!=0){
System.out.println(":)");
} else {
System.out.println(":(");
} https://stackoverflow.com/questions/19755786
复制相似问题