jQuery in Action, 2nd edition*
The moose likes JavaFX and the fly likes how to get the html content in WebView Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JavaFX
Bookmark "how to get the html content in WebView" Watch "how to get the html content in WebView" New topic

how to get the html content in WebView

Bon Gun

Joined: May 30, 2013
Posts: 8
How to get html content in a Web View?
For example,

webview=new WebView();
webengine.loadContent("<b><h1>hello html</h1></b>");

Is there a way to get the html content (<b><h1>hello html</h1></b>) ? How?

Thanks in advance.
John Damien Smith
Ranch Hand

Joined: Jan 26, 2012
Posts: 133
You can serialize the DOM which WebView creates (see get the contents from the webview using javafx for details).

Serializing the DOM isn't quite the same as retrieving the html which was originally loaded into the WebView, as the WebView may have fixed quirks in the markup and JavaScript may have dynamically updated the DOM, but it will likely give you a good enough result for what you want.
I agree. Here's the link: http://aspose.com/file-tools
subject: how to get the html content in WebView
Similar Threads
Reading a HTML file by a buffered reader
HTML to Text via Screen scrape
Spring MVC and access to static html files
Capturing dynamic generated HTML Content on action call
How to get the http version from the http server response