Fetch contents(loaded through AJAX call) of a web page

可紊 提交于 2019-11-27 01:47:54

Jsoup is a html parser only. Unfortunately it's not possible to parse any javascript / ajax content, since jsoup can't execute those.

The solution: using a library which can handle Scripts.

Here are some examples i know:

If such a library doesn't support parsing or selectors, you can at least use them to get Html out of the scripts (which then can be parsed by jsoup).

Jsoup does not handle with Javascript and Ajax, so you need to use Htmlunit or selenium. After loading page using Htmlunit or any you can use jsoup for rest of task.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!