From: <pas...@ya...> - 2004-02-17 15:10:24
|
Hi All, I'm a new user of htmlunit ressources and it's a beginner question. For example, I would like to load an first url, click on a button of it, collect the new page in a HtmlPage and submit the form of the second page. For moment, I load and click correctly the button of my first page and I don't receive the new html content of page in an HtmlPage object. example: /***************************************************/ java.net.URL url = new java.net.URL("http://local/test.html"); WebClient webClient = new WebClient() ; HtmlPage page = (HtmlPage) webClient.getPage(url); try { HtmlForm form = page.getFormByName( "DEBUT" ); HtmlButtonInput buttonInput = (HtmlButtonInput) form.getInputByName("Validate"); HtmlPage newpage = (HtmlPage)buttonInput.click(); logt("title of second page :"+newpage.getTitleText()) ; } catch(com.gargoylesoftware.htmlunit.ElementNotFoundException ex) { logt("Form non trouvée") ; } /***************************************************/ I think that it's a very simple problem but I don't find for moment. Can you help me on it ? Best Regards, Pascal. Yahoo! Mail : votre e-mail personnel et gratuit qui vous suit partout ! Créez votre Yahoo! Mail sur http://fr.benefits.yahoo.com/ |