HTMLUnit : super slow execution?

前端 未结 3 762
情深已故
情深已故 2020-12-30 09:34

I have been using HTMLUnit . It suits my requirements well. But it seems to be extremely slow. for example : I have automated the following scenario using HTMLUnit



        
3条回答
  •  孤独总比滥情好
    2020-12-30 10:06

    • Be sure to use latest htmlunit version (2.9). I had a performance boost from previous version.

    I get your example done within 20s, or 40s depending options i set. As i can't see the webClient initialisation, i guess maybe it could be the problem.

    Here's my initialisation for a 20s treatment :

    WebClient client = new WebClient(BrowserVersion.FIREFOX_3_6);
        client.setTimeout(60000);
        client.setRedirectEnabled(true);
        client.setJavaScriptEnabled(true);
        client.setThrowExceptionOnFailingStatusCode(false);
        client.setThrowExceptionOnScriptError(false);
        client.setCssEnabled(false);
        client.setUseInsecureSSL(true);
    

提交回复
热议问题