Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I am working on a swing application using JAVA FX controls . In my application i have to take print out the html page displayed in the webview . What I am trying is to load the html content of webview in a string with the help of HtmlDocuement.

To load the content of html file from web view,I am using the following code but its not working:

try
{
    String str=webview1.getEngine().getDocment().Body().outerHtml();
}
catch(Exception ex)
{
}
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
147 views
Welcome To Ask or Share your Answers For Others

1 Answer

String html = (String) webEngine.executeScript("document.documentElement.outerHTML");

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...