Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

返回的文章列表不能大于100 #15

Open
sunset-x opened this issue Jul 14, 2021 · 2 comments
Open

返回的文章列表不能大于100 #15

sunset-x opened this issue Jul 14, 2021 · 2 comments

Comments

@sunset-x
Copy link

sunset-x commented Jul 14, 2021

在一个专栏里有大于100个的文章时,该脚本最大只能保存100个文章。
查看代码后发现
_articles 方法中的 'data = res.json().get('data', {})' 返回值中的list最大只有100。如图:
image

@sunset-x
Copy link
Author

有什么完善的方法吗?

@TCeason
Copy link

TCeason commented Jul 14, 2022

390     def _articles(self, cid, pro):
391         """ 获取文章列表接口方法 """
392         global ALL_ARTICLES
393         log.info("请求获取文章列表接口:")
394         url = "https://time.geekbang.org/serv/v1/column/articles"
395         method = "POST"
396         headers = deepcopy(self.common_headers)
397         headers["Host"] = "time.geekbang.org"
398         headers["Origin"] = "https://time.geekbang.org"
399         headers["Cookie"] = self.cookie.cookie_string
400         params = {
401             "cid": cid,
402             "size": 200,
403             "prev": 0,
404             "order": "earliest",
405             "sample": "false"
406         }

"size": 200 这里默认是 100 ,改大一些看看呢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants