Domanda

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

È stato utile?

Soluzione

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");

Altri suggerimenti

Use Jsoup:

Document doc = Jsoup.connect("http://en.wikipedia.org/").get();
Strin html=doc.html();
//save html in a file
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top