【发布时间】:2013-04-16 17:35:36
【问题描述】:
我正在尝试使用 Jsoup 从诺基亚开发者网站http://www.developer.nokia.com/Devices/Device_specifications/Nokia_Asha_308/ 提取移动规范数据。 如何获取每个子类别的数据,例如“相机功能”、“图形格式”等。分开。
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());
}
}
}
【问题讨论】:
标签: java html web-scraping jsoup