1
我正在嘗試使用Jsoup從諾基亞開發人員網站http://www.developer.nokia.com/Devices/Device_specifications/Nokia_Asha_308/提取移動規範數據。 如何獲取每個子類別的數據,例如'相機功能','圖像格式'等。分別。使用Jsoup提取HTML數據
import java.io.IOException;
import java.sql.SQLException;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;
public class Nokiareviews {
public static void main(String[] args) throws IOException, SQLException, InterruptedException {
Document doc = Jsoup.connect("http://www.developer.nokia.com/Devices/Device_specifications/Nokia_Asha_308/").timeout(1000*1000).get();
Elements content = doc.select("div#accordeonContainer");
for (Element spec : content) {
System.out.println(spec.text());
}
}
}