Вот пример с HtmlUnit
public void submittingForm() throws Exception {
final WebClient webClient = new WebClient();
// Get the first page
HtmlPage page1 = webClient.getPage("http://some_url");
// Get the form that we are dealing with and within that form,
// find the submit button and the field that we want to change.
HtmlForm form = page1.getFormByName("myform");
HtmlSubmitInput button = form.getInputByName("submitbutton");
HtmlTextInput textField = form.getInputByName("userid");
// Change the value of the text field
textField.setValueAttribute("root");
// Now submit the form by clicking the button and get back the second page.
HtmlPage page2 = button.click();
webClient.closeAllWindows();
}
Я попытался это ... но это не работает ... (ошибка в Webclient) –
@LoveenaMathews вы можете дать мне адрес страницы, так что я могу проверить? – Arya
URL: www.safesecurities.com.pk –