Java – publishing data using a web client

I'm using the web client to create a submit button, but it doesn't work

This is the code I'm using:

HtmlElement button = firstPage.createElement("button");
 button.setAttribute("type","submit");
 button.setAttribute("name","submit");
 form.appendChild(button);
 System.out.println(form.asXml());
 HtmlPage pageAfterLogin = button.click();

Solution

Simple question, do you include HTML form tags in the page?

HtmlUnit,how to post form without clicking submit button?

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>