Problème avec la classe WebClient avec HTMUnit
Bonjour,
Je sollicite votre aide : J'ai un code java qui permet de faire appel à une page HTML en utilisant HTMLUnit.
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
|
final WebClient webClient = new WebClient();
// Get the first page
final HtmlPage page1 = webClient.getPage("http://google.com");
// Get the form that we are dealing with and within that form,
// find the submit button and the field that we want to change.
final HtmlForm form = page1.getFormByName(nomdemaform);
final HtmlSubmitInput button = form.getInputByName("bSubmit");
final HtmlTextInput textField = (HtmlTextInput) form.getInputByName(nominput).setValueAttribute(unattribut);
// Change the value of the text field
// Now submit the form by clicking the button and get back the second page.
final HtmlPage page2 = button.click();
webClient.closeAllWindows(); |
Or, lors du debuggage le code s’arrête à la première instruction qui est :
Code:
WebClient webClient = new WebClient();
:bug:
Quelqu'un aune solution à ce problème?
Merci beaucoup