From: May, B. L. <bl...@cu...> - 2016-07-27 02:17:07
|
Hey all! First time using this library, just trying to get a page that requires javascript... Code snippet: WebClient webClient = new WebClient(BrowserVersion.CHROME); webClient.getOptions().setJavaScriptEnabled(true); webClient.getOptions().setCssEnabled(false); webClient.getOptions().setRedirectEnabled(true); webClient.getOptions().setThrowExceptionOnScriptError(false); webClient.getOptions().setThrowExceptionOnFailingStatusCode(false); webClient.getOptions().setPrintContentOnFailingStatusCode(true); webClient.getOptions().setThrowExceptionOnScriptError(false); String link = "http://nycprop.nyc.gov/nycproperty/statements/flk/jsp/stmtassessflk.jsp?statementId=104487723"; HtmlPage page = webClient.getPage(link); webClient.waitForBackgroundJavaScript(30 * 1000); String pageAsText = page.asText(); System.out.println(pageAsText); And I am getting a HUGE stackoverflow exception. If you try and view the URL in a browser with JS disabled you get a message about needing to turn it on, but there's barely any javascript in the page source from what I can see... TIA! |