简体   繁体   中英

How to force jsoup to wait for a webpage to load completely

The website I am using jsoup to parse loads incrementally. The data I am trying to access loads into the page after a couple of seconds but jsoup only gets everything that was loaded initially.

Is there a way to force jsoup to wait for the page to load completely before attempting to parse it or to build in a delay to allow the page to load completely?

Jsoup can't deal with such a requirement. Jsoup simply interprets HTML (The wait is because of some AJAX call done after page load, since you have mentioned the page loads incrementally).

Alternate would be to use Selenium which can emulate your browser and handle these elegantly.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM