JSoup:解析Twitter列表

JSoup:解析Twitter列表,twitter,jsoup,Twitter,Jsoup,我想使用JSoup解析Twitter列表(例如)。我的问题是,页面是动态的,也就是说,我只能从页面中获得前20个结果。JSoup有没有办法获取整个页面 目前,我的代码如下所示: Document doc = Jsoup.connect(listAdress).get(); Elements usernames = doc.select(".username.js-action-profile-name"); Elements realNames = doc.select(".fullname.j

我想使用JSoup解析Twitter列表(例如)。我的问题是,页面是动态的,也就是说,我只能从页面中获得前20个结果。JSoup有没有办法获取整个页面

目前,我的代码如下所示:

Document doc = Jsoup.connect(listAdress).get();
Elements usernames = doc.select(".username.js-action-profile-name");
Elements realNames = doc.select(".fullname.js-action-profile-name");
// iterate over usernames and realNames and do something

提前谢谢

一些解决方案可以实现这一点

  • 使用Selenium启动具有上述URL的浏览器
  • 完全加载页面
  • 使用Selenium方法获取页面源代码
  • 将此内容传递给JSOUP
  • 解析它
逻辑


最终通过使用Twitter库解决了问题,但感谢您的帮助。

我认为这是不可能的:
WebDriver driver = new FirefoxDriver();
driver.get("https://twitter.com/spdbt/lists/spd-bundestagsabgeordnete/members")
//some logic to scroll or you do it manually
String pageContent = driver.getPageSource();
Document doc = Jsoup.parse(pageContent);
//from here write your logic to get the required values