我想点击一个sumbmit按钮,但我不知道如何将证书或cacerts设置为webclient。
我正在使用com.gargoylesoftware.htmlunit.WebClient。
WebClient webClient = new WebClient(BrowserVersion.getDefault());
HtmlPage htmlPage = webClient.getPage(urlPost);
HtmlForm form = htmlPage.getForms().get(0);
form.getInputByName("inputLogin").setValueAttribute("login");
form.getInputByName("inputPass").setValueAttribute("passwd");
HtmlPage subm = form.getInputByName("button1").click();
我不知道该怎么做,但我正在尝试
setSSLClientProtocols
subm.getWebClient().getOptions().setSSLClientProtocols(sslClientProtocols);
或setCredentialsProvider
subm.getWebClient().setCredentialsProvider(credentialsProvider);