0

I am trying to parse an HTML page on the internet to retrieve data from a table in it with 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

I want to retrieve data from the tables with book info.

3
  • It is entirely possible. Get a list of tables matching your requirements and iterate over them. Commented Jan 5, 2014 at 22:47
  • Kindly add the html you want to parse and indicate the table you want. Commented Jan 5, 2014 at 22:58
  • Did my answer help? If yes, please mark it so the topic can be considered closed. If not, please provide some feedback, or an answer of your own. Commented Sep 7, 2014 at 12:17

1 Answer 1

1
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());
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.