Stackoverflow に記載されているほとんどすべての方法を試しましたが、どれも機能しませんでした...
HtmlUnit を使用して次のページをスクレイピングしようとしています: http://www.nseindia.com/corporates/offerdocument/past_issue_document.htm
空のページだけが返されました。JavaScriptの問題が原因である必要があります。HtmlUnit で以下のトリックを試みました:waitForBackgroundJavaScript、refresh、redirect、sleep、enable javascript、click(true, true, true) など。
なにか提案を:
私のコード:
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());
どうもありがとう!