2
我被困在那里我需要解析this网站,并通过与他们的收视率Metascore显示前的PlayStation 3游戏的地方。我刚开始使用Jsoup开发时,我无法使用JSoup进行良好的解析。JSOUP网站HTML解析:Java的
我得到了这样的评级和标题。有更好的方法吗?
Document doc = Jsoup.connect(URL).userAgent("Mozilla").get();
// To get score
Elements links = doc.select("span.metascore_w.medium.game");
// To get title
Elements links = doc.select("h3.product_title");
for (Element link : links) {
System.out.println("text : " + link.text());
}
您可以发布您的尝试以获得更快的解决方案 – PopoFibo
@PopoFibo代码添加 – AnujKu