I am using HtmlUnit to read content from a web site.
Everything works perfectly to the point where I am reading the content with:
HtmlDivision div = page.getHtmlElementById("my-id");
Even div.asText()
returns the expected String object, but I want to get the original HTML inside <div>...</div>
as a String object. How can I do that?
I am not willing to change HtlmUnit
to something else, as the web site expects the client to run JavaScript, and HtmlUnit
seems to be capable of doing what is required.