使用Jsoup catch网站数据无法在控制台显示

时间:2017-04-09 16:22:54

标签: java android jsoup

我想要捕获表数据并在控制台显示 链接:http://www.laliga.es/en/statistics/laliga-santander

代码:

public class pldata {
    public static void main(String[] args){
    try {
        Document doc = Jsoup.connect("http://www.legaseriea.it/en/serie-a-tim/league-table").get();
        Elements Playeds = doc.select("td.blue");
        for(Element Played:Playeds)
        {
            String found = Played.text();
            System.out.println(found);
        }
    } catch (IOException e) {
        e.printStackTrace();
    }
    }
}

1 个答案:

答案 0 :(得分:0)

查看您的doc.select("CLASS NAME GOES HERE")班级名称,“td.blue”不在您提供的链接中,找出元素的相应css选择器右键单击你想要的元素,看看Inspector的上半部分,它在图片中以蓝色箭头显示,使用它作为选择器,希望这会有所帮助。

enter image description here