I need to get the HTML code as it is sent by the server. Notice that the method asXml()
returns something similar but is formatted.
Is there a way to solve this using this library or do I have to resort to low-level calls?
I need to get the HTML code as it is sent by the server. Notice that the method asXml()
returns something similar but is formatted.
Is there a way to solve this using this library or do I have to resort to low-level calls?
I think the closest to what you're looking for is:
For HtmlUnit 2.13 and higher, use
webclient.getOptions()
.You may also find this question interesting.
Finally, to get the original content of the page (instead of the output of
asXml()
) try the following:(Translated from this StackOverflow question)