Extracción de contenido de 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?

preguntado el 03 de mayo de 12 a las 17:05

1 Respuestas

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()

Respondido el 26 de enero de 13 a las 22:01

I viewed an XML export in WebView and it wad rendered in a way that looked very odd. In IE or Chrome I would just see the raw XML. In the JavaFX WebView component it didn't show up as xml. Any ideas? - espina

Sorry, no. That sounds like a different question. - Andrés

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.