2016-12-11 10 views
0

こんにちは私は "jsoup"を使って新しいです そして、このページからデータを抽出しようとしましたが、それ以上は "id"と "class"を組み合わせて何も表示しません。JSOUP。このページでselectを使ってデータを抽出する方法は?

enter image description here

コードこのです:それはあなたの情報を抽出した場合、他のページと

Document d = getHtmlDocument("http://www.mismarcadores.com/futbol/inglaterra/league-one/resultados/"); 
System.out.println("El Status Code es: "+getStatusConnectionCode("http://www.mismarcadores.com/futbol/inglaterra/league-one/resultados/")); 

Elements ele=d.select("#fs-results"); 
System.out.println("Numero de entradas en la pagina mismarcadores: "+ele.size()+"\n"); 

おかげで.....

答えて

0

私はあなたがこのような何かの後になるだろうと信じて:このページのデータを含むタグが<ある

Element element = d.getElementById("fs-results"); 

または

Elements elements = d.getElementsByClass("fs-table"); 
+0

あなたが指すタグは空です。

ProgrammersBlock

0

div id = "トーナメントページデータ結果" >。このコードはそのデータを取得します。しかし、データのフォーマットは私にとって非常に奇妙で、私はそれを手助けすることができません。 データを見つけるには、ブラウザでページを右クリックし、「ソースコードを表示」し、ソースコードを調べ、データでタグを識別します。

Document d = Jsoup.connect(url).get(); 
//Option 1. 
Element element = d.getElementById("tournament-page-data-results"); 
System.out.println(element.text()); 
//Option 2 with select. 
Elements element2 = d.select("#tournament-page-data-results"); 
System.out.println(element2.get(0).text()); 
関連する問題