From: Ahmed A. <asa...@ya...> - 2015-05-21 10:12:23
|
Hi, You don't need to cross post ;) This is because HtmlUnit caches the response, and there is redirection to another page then returning back.I tested with the below, and it works:client.getCache().setMaxSize(0); Now, whether caching should consider the cookies, that's something to be decided. Ahmed From: gaurab.pradhan <mer...@gm...> To: htm...@li... Sent: Thursday, May 21, 2015 10:33 AM Subject: Re: [Htmlunit-user] How to handle Too much redirect Dear Ahmed, Thanks for your reply, yes i have subscribe. This is not my website, i want to parse the site but i getting above mention exception. WebClient client = new WebClient(BrowserVersion.FIREFOX_24); HtmlPage homePage = null; String url = "http://www.freelake.org/pages/Freetown-Lakeville_RSD/Departments/Director_of_Financial_Operatio"; try { client.getOptions().setUseInsecureSSL(true); client.setAjaxController(new NicelyResynchronizingAjaxController()); client.getOptions().setThrowExceptionOnFailingStatusCode(false); client.getOptions().setThrowExceptionOnScriptError(false); client.waitForBackgroundJavaScript(30000); client.waitForBackgroundJavaScriptStartingBefore(30000); client.getOptions().setCssEnabled(false); client.getOptions().setJavaScriptEnabled(true); homePage = client.getPage(url); synchronized (homePage) { homePage.wait(25000); } System.out.println(homePage.asXml()); } catch (Exception e) { e.printStackTrace(); } Thanks -- View this message in context: http://htmlunit.10904.n7.nabble.com/How-to-handle-Too-much-redirect-tp36130p36135.html Sent from the HtmlUnit - General mailing list archive at Nabble.com. ------------------------------------------------------------------------------ One dashboard for servers and applications across Physical-Virtual-Cloud Widest out-of-the-box monitoring support with 50+ applications Performance metrics, stats and reports that give you Actionable Insights Deep dive visibility with transaction tracing using APM Insight. http://ad.doubleclick.net/ddm/clk/290420510;117567292;y _______________________________________________ Htmlunit-user mailing list Htm...@li... https://lists.sourceforge.net/lists/listinfo/htmlunit-user |