2017-04-09 24 views
0

顯示我想在控制檯趕上表數據和顯示 鏈接:http://www.laliga.es/en/statistics/laliga-santander使用Jsoup抓網站數據無法在控制檯

代碼:

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(); 
    } 
    } 
} 

回答

0

看看你doc.select("CLASS NAME GOES HERE")類名,「td.blue 「不在您提供的鏈接中,找到適當的元素CSS選擇器,右鍵單擊所需的元素,然後查看Inspector的上半部分,它顯示在圖片的藍色箭頭中,作爲選擇器,希望這有助於。

enter image description here