Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

how to get the html content in WebView  RSS feed

 
Bon Gun
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 337
21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!