I have tried almost all the methods mentioned in Stackoverflow, but none of them worked...
I'm trying to scraping following page using HtmlUnit: http://www.nseindia.com/corporates/offerdocument/past_issue_document.htm
Just an empty page returned. It should be caused by javascript issue. I tried following tricks in HtmlUnit: waitForBackgroundJavaScript, refresh, redirect, sleep, enable javascript, click(true, true, true), etc. None of them worked...
Any suggestion:
my code:
String url = "http://www.nseindia.com/corporates/offerdocument/past_issue_document.htm";
WebClient webClient = new WebClient(BrowserVersion.INTERNET_EXPLORER_8);
webClient.setJavaScriptEnabled(true);
HtmlPage page = (HtmlPage) webClient.getPage(url);
this.getWebClient().waitForBackgroundJavaScriptStartingBefore(5000);
System.out.println(page.asXml());
Thanks a lot!
webClient.setAjaxController(new NicelyResynchronizingAjaxController());. This will cause the AJAX to block the call until it is completed.