Html parser with java
I have a simple question: Let's supose i have the next span:
<span class="data" id="random"> Here the piece of string i need </span>
How can i get what's inside of the span?
HTML Parser is a HTML parser for Java.
Try this: JSoup, is an HTML parser for Java.
Document doc = Jsoup.connect("LINK_TO_YOUR_PAGE").get(); Elements random = doc.select("#random"); System.out.println(random.html());
If you just want to use core classes rather than an HTML parser, you could use a regular expression to capture the contents of the span.
The "related" section for this question shows a lot of people asking similar parsing questions.