同样,根据我的评论,您需要在上下文中向我们展示您的代码,以显示其工作方式.
例如,当我尝试分析以下简单文本时:
some inner content
使用此代码:
import java.io.IOException;
import java.util.Scanner;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.select.Elements;
public class Foo {
public static void main(String[] args) throws IOException {
Scanner scan = new Scanner(Foo.class.getResourceAsStream("Foo.txt"));
String text = "";
while (scan.hasNextLine()) {
text += scan.nextLine() + "
";
}
Document doc = Jsoup.parse(text);
Elements eles = doc.select("div.class_one.class_two.class_three.classfour.classfive.classsix");
System.out.println(eles);
}
}
我得到这个结果:
some inner content
建议您使用select应该可以,如果不起作用,则可能正在发生其他情况.最好的选择是做我刚刚做的事情:发布一些数据和一些可编译的可运行代码(SSCCE),并让它们显示您的代码是如何工作的.