I have got an html page in which the UI is generated using javascript.I am interested in a form which is visible when the page is inspected using developer tools but not in html source. In htmlunit i tried to wait for the javascript to execute and then print it as Xml but DOM elements are not seen!!How can i do this??Please help
HtmlPage.getDocumentElement().asXml()
This can be tested using
System.out.println(page.getDocumentElement().asXml());
on
<html>
<body>
<div id="lj">
</div>
<script>
document.getElementById("lj").innerHTML = "Foo";
</script>
</body>
</html>
will show
<div id="lj">
Foo
</div>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With