简体   繁体   中英

Click( ) function of HtmlUnit not working

I was trying to login to yahoo pipes account (using the login page) with a program. Below is the code I am using. On clicking the "Sign In" button this page http://pipes.yahoo.com/pipes/ should open. But looks like the click() function is not working properly. Since the contents of pages before and after the clicking the "Sign In" button are same. This code returns true.

I am not able to figure out whats going wrong. Can someone suggest what I am missing?

Add this:

webClient.setJavaScriptEnabled(false);
// You can re-enable JS later

Then, remove this:

webClient.setRefreshHandler(new RefreshHandler() {
    public void handleRefresh(Page page, URL url, int arg) throws IOException {
        System.out.println("handleRefresh");
    }
});

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM