문제

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

도움이 되었습니까?

해결책

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

다른 팁

Use Jsoup:

Document doc = Jsoup.connect("http://en.wikipedia.org/").get();
Strin html=doc.html();
//save html in a file
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top