Thorn
Thorn

Reputation: 4057

Exteacting content from JavaFX2 WebView

The JavaFX 2 WebView component might provide me with a convenient way to connect my software to existing school data management web applications without needing a direct connection to the database. Right now a secretary would run an export from the data management program, save the data as CSV, then import the data into my program. This process might need to be repeated 30 times, so I am investigating other ways of extracting the data my software needs.

I wonder if the following solution is possible: Emben a Java FX 2 WebView component into my program. The user would then log into the data management web application and extract the data the wish to import. Most of these school management programs support CSV and XML as the file format.

If I can extact the content currently being viewed by WebView, I should be able to parse the XML and import the data. This would be less steps for the user with the added benefit that I can infer information about the database structure from the XML export more easily than from a CSV file.

I didn't see any method in the Java FX 2 JavaDocs for WebView that does what I want. Is there a way to get the content from the page?

Upvotes: 0

Views: 806

Answers (1)

Andrew
Andrew

Reputation: 4624

A WebView is a node that displays the content of a WebEngine. The methods you want are in WebEngine.

Ex: you can get the document using webView.getEngine().getDocument()

Upvotes: 2

Related Questions