Bachayer
Bachayer

Reputation: 37

Showing the document after modification

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

Upvotes: 0

Views: 720

Answers (1)

Rasel
Rasel

Reputation: 15477

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

Upvotes: 0

Related Questions