Bonjour,
J'utilise HtmlUnit pour remplir un formulaire dans un site distant. Mon problème est dans ce site le formulaire est défini comme ce ci:
c-à-d il n y a pas d'attribut "name", j'ai besoin de cet attribut car la classe "HtmlPage" ne possède que la méthode "getFormByName"
Code : Sélectionner tout - Visualiser dans une fenêtre à part <form id="MiniConnexion" action="" method="post">
Voici une partie de mon code :
SVP, aidez moi, je me suis coincé
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5 final HtmlPage page1 = webClient.getPage("http://url-site-distant"); // 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("MiniConnexion");
Merci d'avance.
Partager