From: SALL O. <osa...@ya...> - 2005-04-27 10:01:48
|
<html> <body> <script> function submitForm2() { leform2.varform2.value="javascriptModified2"; leform2.submit(); } </script> <form action="http://www.yahoo.fr" name="leform2"> <input type="text" name="varform2" value="valform2"> <input type="button" onclick="submitForm2()" value=submit> </form> </body> </html> Excuse with my poor english,I use the htmlUnit jar for getting javascript redirection after submitting a form like the one in the top of this message normaly the URL of the new page would : http://fr.yahoo.com/?varform2=javascriptModified2 But on page.getWebResponse().getUrl().toExternalForm()) the value is : http://fr.yahoo.com/ Or I want to get the new URL with the parameter of the for and new values like a browser do. Here is the part of Java code I use for getting the new URL : List listInput= page.getDocumentElement().getHtmlElementsByTagName("form"); for (Iterator iter = listInput.iterator(); iter.hasNext();) { HtmlForm formul = (HtmlForm) iter.next(); System.out.println("New URL -> "+formul.submit().getWebResponse().getUrl().toExternalForm()); } Thanks for help. --- OSall __________________________________________________________________ Découvrez le nouveau Yahoo! Mail : 250 Mo d'espace de stockage pour vos mails ! Créez votre Yahoo! Mail sur http://fr.mail.yahoo.com/ |