开发者

Showing the document after modification

开发者 https://www.devze.com 2023-03-15 20:59 出处:网络
After I made many changes to the HTML document using JSoup so what I did is I have a peocessing page where I fetch the page from the website and insert some tags to the head as follow:

After I made many changes to the HTML document using JSoup so what I did is I have a peocessing page where I fetch the page from the website and insert some tags to the head as follow:

 Document doc = Jsoup.connect(url).get();
 Element head=doc.select("head").first();
  ...etc 

I want to display the document as an HTTP response (what I mean how to display the page in the browser)

I read about JSOUP but I could not find anything related to displaying the HTML document after making some modification!!

开发者_高级运维

please I need help or guide and if my understanding is not good please tell me a good book to start learning JSoup


Your code doesn't insert tag. It actually fetches selecting html element by matching the tag.Jsoup is a unidirectional thing.It doesn't send data to the actul page.

For better understanding

see these

http://jsoup.org/cookbook/extracting-data/example-list-links

http://desicoding.blogspot.com/2011/03/how-to-parse-html-in-java-jsoup.html

to show complete page in java see below

http://forums.devshed.com/java-help-9/display-web-page-in-jpanel-in-applet-504590.html

To display webpage in android

webview

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号