Problem in HtmlUnit API for Java (Headless Browser)? -


I can see the site to better understand the HtmlUnit headless'm using a browser (you have problems to browse it Are).

I have set the value of the selection for the following values ​​from "1"

  the last webclient webClient = New WebClient (BrowserVersion.INTERNET_EXPLORER_7); Try {// Webclient webClient.setJavaScriptEnabled (true) configuring; WebClient.setThrowExceptionOnScriptError (wrong); WebClient.setCssEnabled (true); WebClient.setUseInsecureSSL (true); WebClient.setRedirectEnabled (true); WebClient.setActiveXNative (true); WebClient.setAppletEnabled (true); WebClient.setPrintContentOnFailingStatusCode (true); WebClient.setAjaxController (new opt-in syncExpress controller ()); // listeners to add Vebkeliattkvebvindo Listnr (new Comkgrajelskeftveyrkcomkvibvandolistnr () {public Wide Vebvandoovend (Vebvandoivent event) {number Oops Waibondoanupatit ++ System. Autkprintlain ( "opened number of Vebvando:" + Snkyaofwabvandoanudharit);} public vain Vebvandosncharwadi (WebWindowEvent event) {} public void WebWindowClosed (WebWindowEvent event) {numberOfWebWindowClosed ++; System.out.println ( "number of Close WebWindow:" + nu MberOfWebWindowClosed);}}); WebClient.setWebConnection (new HttpWebConnection (Vebclaint) {public WebResponse GetResponse (WebRequestSettings settings) throws IOException {System.out.println (settings.getUrl ()); return super.getResponse (settings);}}); Cookie Manager = New Cookie Manager (); WebClient.setCookieManager (cm); Actimafej page = Vebcleintkjet page ( "http://www.ticketmaster.com/event/0B004354D90759FD?artistid=1073053&majorcatid=10002&min.minorcatid=207"); Select HTML = (HTML Selection) page .getElementById ("quantity_select"); Select.setSelectedAttribute ("1", true);  

and then clicked on the button

  HtmlButtonInput button = (HtmlButtonInput) Page.getElementById ("find_tickets_button"); HtmlPage Captcha page = button. Click (); Thread.Sleep (60 * 1000); System.out.println ("====== Captcha Page ======="); Println (captchaPage.asXml ());  

But after clicking on the button and waiting for 60 seconds through the thread () method, I am getting the same HTML grade.

But when I do the same thing through the real browser, I get a captcha page.

I think I'm missing something in the htmlunit.

Q1 Why do not I get the same page (Captcha included) via HTMLunit's browser?

Web form that page needs to fill in the volume_ style drop down. You are trying to do this by assuming the drop-down is a selection element in your code, however, it is no longer a select element, try using firebug to observe the drop-down and you will see that JavaScript The selection is replaced with the complex set of nested div elements.

If you understand how to simulate how to simulate each user on the devices for that unusual drop-down, then you should be able to submit the form.


Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -