Hello, I am engaged in parsing the site with Jsoup tools, I want to parse the page, but it does not have time to load completely as I receive the page, since the page is loaded with ajax. http://www.flashscore.com/match/fJ12apqa is an example page. I get a lot of "Loading ...".
- It's not about “not having time,” but about “not going at all.” What is loaded via AJAX is loaded by the browser due to JavaScript scripts. Your Java program just picks up the page. No scripts run. When parsing, these downloads need to be simulated or, in a more complicated case, to feed the JavaScript engine - tutankhamun
- And do not tell me how to implement it? Selenium? - Drerek
- In a nutshell I will not say. I haven’t done this myself yet, but there are several directions: 1. Find requests by code (if they are not too difficult to assemble) and execute them from your code; 2. Imitation of the browser (or your version with Selenium or options from here stackoverflow.com/q/19759421/3349900 - tutankhamun
- In general, I figured out, used the second option, loaded the driver, parsil jsoup. Put a condition on the waiting element in 10 seconds (maximum), although in fact more than one second was nowhere, well, and the delay between requests 5 seconds - Drerek
|