您好我正在开发一个软件,因为我需要登录弹出窗口,但我无法获得表格和输入(电子邮件)和密码但我尝试使用java selenium,因为我登录成功但我不能在htmlunit(网站)在该模拟账户登录中是https://www.aaafx.com/BinaryOptions.aspx),
代码是:
WebClient webClient = new WebClient(BrowserVersion.FIREFOX_38);
webClient.getOptions().setJavaScriptEnabled(true);
webClient.getOptions().setCssEnabled(true);
webClient.getOptions().setUseInsecureSSL(true);
webClient.getOptions().setThrowExceptionOnFailingStatusCode(false);
webClient.getCookieManager().setCookiesEnabled(true);
webClient.setAjaxController(new NicelyResynchronizingAjaxController());
webClient.getOptions().setThrowExceptionOnScriptError(false);
webClient.getOptions().setTimeout(180000);
webClient.getCookieManager().setCookiesEnabled(true);
HtmlPage page = webClient.getPage(url);
page.getHtmlElementById("sopDemoLogin").click();
System.out.println("Login clicked :"+page.getHtmlElementById("sopDemoLogin").getId());
HtmlTextInput email = page.getElementByName("email");
HtmlPasswordInput password = page.getElementByName("password");
email.click();
email.setValueAttribute("email");
password.click();
password.setValueAttribute("password");
System.out.println("Email : "+email.getValueAttribute());
System.out.println("password : "+password.getValueAttribute());
但它显示另一个表单文本输入和密码输入 不在模拟账户登录表单中 提前致谢