【发布时间】:2020-07-26 16:38:44
【问题描述】:
我正在尝试抓取该网站,https://www.huntr.co/jobs,它有大约 100 万个列表。我检查并发现该网站已加载 ajax,因此决定使用其 API(https://app.huntr.co/public/search/job-posts?page=1)抓取该网站。该网站以 json 格式加载数据,当我更改“page=”时,我会得到一个包含新数据的新页面。但是每当我越过“page = 332”时,API 都会在 json 中给出以下消息:
{"message":"[query_phase_execution_exception] Result window is too large, from + size must be less
than or equal to: [10000] but was [30030]. See the scroll api for a more efficient way to request
large data sets. This limit can be set by changing the [index.max_result_window] index level
setting.","error":{"status":500}
我不明白什么是滚动 api 以及如何请求它。由于这个错误,我只能从 100 万个列表中抓取大约 10,000 个列表。我在这个项目中使用 python。任何解决方案都将受到高度赞赏!
【问题讨论】:
-
我得到了
332的结果 -
332之后没有结果,试试333或者335吧!
标签: python api web-scraping beautifulsoup