Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

Personally, I favour JSoup over JTidy . It has CSS-like selectors , and the documentation is much better, imho. With JSoup, you can easily extract those values with the following lines:

Document doc = Jsoup.connect("your_url").get();
Elements spans = doc.select("span[itemprop]");
for (Element span : spans) {
  System.out.println(span.text()); // will print 234 and 690
                @vivek_jonam: Then use text() instead, which gives you the content of span. I've edited my answer.
– João Silva
                Aug 15, 2012 at 14:28
                ok. works. But can i get the values with A and B alone? there are other itemprop values like A1, C, E, etc.
– vivek_jonam
                Aug 15, 2012 at 14:33
                Yes, there are two ways of doing this. 1) When you are iterating over each span element, you can check if span.attr("itemprop") equals A or B; 2) You can run two selects, one with span[itemprop=A] and the other with span[itemprop=B].
– João Silva
                Aug 15, 2012 at 14:34
        

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.