This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
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 OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP 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
Author

how to get the html content in WebView

Bon Gun
Greenhorn

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

webview=new WebView();
webengine=webview.getEngine();
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: 147
    
    9
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