Question

I made a little research about how to request http sites and explore them offline; I found this as one possible answer:

http://www.javaworld.com/jw-05-2000/jw-0518-offload.html

but the thing is, it's not so complete or intuitive. Does anyone have one good literatur source about this topic that I could use?

Thanks in advance

Was it helpful?

Solution

Use Jsoup: Java HTML Parser

jsoup is a Java library for working with real-world HTML. It provides a very convenient API for extracting and manipulating data, using the best of DOM, CSS, and jquery-like methods.

Reading the content is as easy as this:

Document doc = Jsoup.connect("http://en.wikipedia.org/").get();
Elements newsHeadlines = doc.select("#mp-itn b a");

OTHER TIPS

Use Jsoup:

Document doc = Jsoup.connect("http://en.wikipedia.org/").get();
Strin html=doc.html();
//save html in a file
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top