我正试图从wizzair网站上获取价格以供个人使用,我在这里搜索了很多问题,这些问题有助于我编写以下代码:
Logger.getLogger(“ com.gargoylesoftware.htmlunit”)。setLevel(java.util.logging.Level.OFF); Logger.getLogger(“ org.apache.http”)。setLevel(java.util.logging.Level.OFF);
String url = "https://wizzair.com/#/booking/select-flight/BUD/SKG/2019-02-18/2019-02-23/1/0/0/0/null";
final WebClient webClient = new WebClient(BrowserVersion.FIREFOX_3_6);
webClient.setAjaxController(new NicelyResynchronizingAjaxController());
webClient.setThrowExceptionOnScriptError(false);
HtmlPage page = webClient.getPage(url);
webClient.waitForBackgroundJavaScript(30000);
String content = page.asXml();
System.out.println(content);
它避免了异常,并打印了一些值,但不是全部,并且以某种方式也没有加载价格,只是一些基本的东西。我想念什么?