【发布时间】:2023-01-25 04:28:30
【问题描述】:
如果你使用谷歌的 API,你会得到一些书。例子:
https://www.googleapis.com/books/v1/volumes?q=harry&printType=books&startIndex=0&maxResults=40
这将获得 40 本独特的书籍。
现在,如果你使用分页,你只会一次又一次地得到相同的书。
尝试 https://www.googleapis.com/books/v1/volumes?q=harry&printType=books&startIndex=0&maxResults=8
然后https://www.googleapis.com/books/v1/volumes?q=harry&printType=books&startIndex=8&maxResults=8
然后https://www.googleapis.com/books/v1/volumes?q=harry&printType=books&startIndex=16&maxResults=8
每次您都会得到同一本书,例如Labor and Monopoly Capital,但如果您不使用分页则不会。
我猜 Google 再也请不起真正的工程师了。
真是笑话。多次运行(刷新页面)。它在两本书之间交替。
https://www.googleapis.com/books/v1/volumes?q=harry&printType=books&startIndex=7&maxResults=1
totalItems在结果改变的时候也会改变。多么尴尬。
【问题讨论】:
标签: google-books