HtmlUnit not work for a page in

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

HtmlUnit not work for a page in

Xue-Feng Yang
Hi, I used HtmlUnit for getting some other web pages. It works great.

However, when I tried , I got the page source code without running the javascript code.

Here are the summary of my system:

OS: win 10
Java: jdk1.8.0_131
HtmlUnit: htmlunit-2.27-bin

eclipse-debug gives the result HtmlUnit got. The main code is as follows:

        webClient = new WebClient(BrowserVersion.FIREFOX_45);
        webClient.getOptions().setTimeout(600 * 1000);
        webClient.waitForBackgroundJavaScript(600 * 1000);

        htmlPage = webClient.getPage(_url);
        page = htmlPage.asXml();

The return page is a subset of view-source in Firefox. I found the JavaScript inspector in Firefox has the full HTML tree.

My question is how to get the HTML tree of this page by use of HtmlUnit.



Check out the vibrant tech community on one of the world's most
engaging tech sites,!
Htmlunit-user mailing list
[hidden email]