で使用される、必要以上のフィールドを解析し、だから私はこのサイトから都市を解析しようとしてきた:https://en.wikipedia.org/wiki/List_of_cities_in_SwitzerlandはJsoupは、Java
私はjsoupする新たなんだので、私は都市の名前を取得しようとしました、しかし、私は都市のすべての要素を得る。例えば
Document doc = Jsoup.connect("https://en.wikipedia.org/wiki/List_of_cities_in_Switzerland").userAgent("Mozilla").get();
String title = doc.title();
Elements test = doc.select("table.wikitable").select("tbody").select("tr");
for (Element link : test) {
Elements temp = link.select("td").select("a");
System.out.println(temp.text());
}
私はあなたが非常に多くselect
の呼び出しを追加することで、物事が複雑になり過ぎているだけAarberg