简体   繁体   English

Android使用Jsoup解析多个HTML表

[英]Android parsing multiple HTML tables with Jsoup

I am trying to parse an HTML page on the internet to retrieve data from a table in it with Jsoup. 我正在尝试解析Internet上的HTML页面以使用Jsoup从其中的表中检索数据。 But the page I want to parse contains more than one table. 但是我要解析的页面包含多个表。 How can I do that? 我怎样才能做到这一点? Is that possible? 那可能吗?

Edit: Here is the page I want to parse: 编辑:这是我要解析的页面:

http://metudex.com/mobilepac/browse.php?SEARCH=calculus&kriter=X&Submit=Search http://metudex.com/mobilepac/browse.php?SEARCH=calculus&kriter=X&Submit=Search

I want to retrieve data from the tables with book info. 我想从带有书籍信息的表格中检索数据。

Document doc = Jsoup.connect("http://metudex.com/mobilepac/browse.php?SEARCH=calculus&kriter=X&Submit=Search").get();

Elements els = doc.select("td:has(span.briefcitDetail)"); //gets every td that has a child span with class briefcitDetail

for(Element el : els) {
    System.out.println("--" + el.text());
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM