Forums Register Login

how to get the html content in WebView

+Pie Number of slices to send: Send
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.
+Pie Number of slices to send: Send
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 love a woman who dresses in stainless steel ... and carries tiny ads:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 12158 times.
Similar Threads
Spring MVC and access to static html files
How to get the http version from the http server response
Capturing dynamic generated HTML Content on action call
Reading a HTML file by a buffered reader
HTML to Text via Screen scrape
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 17:49:18.