且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

使用JSoup提取表数据

更新时间:2023-12-03 20:39:34

Psherno提供的答案:

Answer provided by Psherno:

打印可以从页面读取的文档(使用System.out.println(doc);).某件事告诉我,您的问题可能与您要查找的HTML内容是由浏览器由JavaScript动态添加的事实有关,Jsoup无法做到这一点,因为它不支持JavaScript.在这种情况下,您应该使用功能更强大的工具,例如Web驱动程序(例如Selenium).

Print what Document was able to read from page (use System.out.println(doc);). Something tells me that your problem may be related with fact that HTML content you are looking for is dynamically added by JavaScript by browser, which Jsoup can't do since it doesn't have JavaScript support. In that case you should use more powerful tool like web driver (like Selenium).