A
A
Alexander20142014-03-14 12:41:49
JavaFX
Alexander2014, 2014-03-14 12:41:49

How to get iframe content of loaded page using javafx webview?

A frame is loaded in the open page:

<iframe id="wikipedia" src="http://en.wikipedia.org"></iframe>

Trying to get to content:
Document document = webEngine.getDocument();
Element elementById = document.getElementById("wikipedia");
System.out.println(elementById.getTextContent());

But I'm not getting results...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
volna80, 2014-03-22
@volna80

if the frame loaded a resource from another domain, then no way. Just do some workarounds (forward data through your own site)
en.wikipedia.org/wiki/Same_origin_policy

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question