(new WebView()).getHTML() method anywhere? ...

Albretch Mueller lbrtchx at gmail.com
Thu Aug 17 04:34:03 UTC 2023


 I have some JavaFX/WebView code, which outlines looks like:

 WbView = new WebView();
 WbView.getEngine().setJavaScriptEnabled(true);

 WbView.getEngine().load(aURL);  //Use to see what happens after 15 seconds.

 Worker<?> Wrkr = WbView.getEngine().getLoadWorker();
// __ observe 'running' property to start/stop TmOut
 Wrkr.runningProperty().addListener(this::loaderRunningChanged);
// __ observe 'state' property to handle success/failure
 Wrkr.stateProperty().addListener(this::loaderStateChanged);

 TmOut.setOnFinished( e -> { Wrkr.cancel(); handletimeout(); });
 Scene scene = new Scene((new VBox(WbView)), 960, 600);
 primaryStage.setScene(scene); primaryStage.show();
~
 I need to get the html source page after the page has been fully
loaded (including javascript generated code) to then tidy up the page.
 How do I get the html page?
 If this is not possible, why would Webkit/JavaFX/whoever ... road
block such a useful option?

 lbrtchx


More information about the openjfx-discuss mailing list