Rectangle 27 0

java The Web Browser show the correct values but when I use Jsoup the HTML doesn't have the values?


The website uses JavaScript to populate all of the values you are trying to parse. You will have to use a library that can compute the javascript within the page. Not sure if there is one though.

Note
Rectangle 27 0

java The Web Browser show the correct values but when I use Jsoup the HTML doesn't have the values?


Here is the code tha I used: final WebClient webClient = new WebClient(BrowserVersion.FIREFOX_3_6); webClient.setAjaxController(new NicelyResynchronizingAjaxController()); webClient.waitForBackgroundJavaScript(10000); final HtmlPage page = webClient.getPage("submarinoviagens.com.br/Passagens/); webClient.waitForBackgroundJavaScriptStartingBefore(10000);

I don't know about Jericho but Jsoup parses static HTML, i.e. the HTML that may be output by HtmlUnit after running the Javascript. But you can do the extraction with HtmlUnit, you don't need Jsoup then.

Thank's his, I used the HTMLUnit and It worked. The problem was the javascript. So, I tell the HTMLUnit to waitForBackgroundJavascript and I can get the values now. But how can I force the Jsoup or Jericho to wait for the javascript. Can you use Jsoup or Jericho to do this, can't I?

Note