HtmlUnit 的 Click( ) 函数不起作用

发布于 2025-01-03 11:11:34 字数 247 浏览 2 评论 0原文

我试图使用程序登录 yahoo Pipes 帐户(使用登录页面)。下面是我正在使用的代码。单击此页面的“登录”按钮http://pipes.yahoo.com/pipes/应该打开。但看起来 click() 函数无法正常工作。由于点击“登录”按钮前后的页面内容是相同的。此代码返回 true。

我无法弄清楚出了什么问题。有人可以建议我缺少什么吗?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

小ぇ时光︴ 2025-01-10 11:11:34

添加此:

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

然后,删除此:

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

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");
    }
});
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文