Java – htmlunit – convert htmlpage to HTML string?

I'm using htmlunit to generate HTML for various pages, but now, the best way I can put the page into the original HTML returned by the server is to convert htmlpage to XML string

This is a bit annoying because the XML output rendered by a web browser is different from the original HTML Is there any way to convert HTML pages to raw HTML instead of XML?

thank you!

Solution

page. Asxml () will return HTML page. Astext() renders it as text only

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>