javascript - 如何使用 JS 的“加载更多”按钮从网站上抓取数据
问题描述
我正在尝试用 JS 抓取 Google Scholar 网站。该表在底部加载了“加载更多”按钮。如需参考,请参阅此页面:https ://scholar.google.com/citations?hl=en&user=m8dFEawAAAAJ
显然我在“加载更多”按钮上使用了 btn.click() ,直到该按钮被“禁用”。然后,我抓取了数据。有人可以告诉我一个更好的方法来抓取整个表格数据吗?
解决方案
If you click on the Show more
button, you can see that the next request is made with the following query string attached to the end of the url:
&cstart=20&pagesize=80
With cstart
probably referencing something like count start, you could swap the parameter values to something like this, which should display the next 1000 items starting with the first:
https://scholar.google.com/citations?hl=en&user=m8dFEawAAAAJ&cstart=1&pagesize=1000
推荐阅读
- google-signin - 在 Google Family Link 帐户登录期间访问被拒绝
- react-admin - React Admin“指定的令牌无效”问题
- sql - 从存储在 postgresql 列中的数组中删除 json 对象
- octave - 计算从第二个向量化实现开始的所有元素的每个元素的平均值,即行向量中的前一个和下一个元素
- elasticsearch - 如何在弹性搜索中基于多个地理点搜索文档?
- sql - 如何修改/更新 json 数组中的多个值
- java - 未找到 XmlElement 注释
- php - 对 Php PDO 中的所有数据进行排名
- python - 如何使用对象检测打印数字而不是类标签并在图像上评分
- c# - 如何在wpf中输出和输入文本框/组合框的值