Skip to content
This repository has been archived by the owner on Mar 12, 2024. It is now read-only.

Commit

Permalink
Use total_count / 80 rather than total_page / 80 (#61)
Browse files Browse the repository at this point in the history
  • Loading branch information
puppylpg authored Dec 21, 2020
1 parent cbd27fe commit be1425f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,3 +129,7 @@
* 功能
- buff有个`page_size`参数,实验发现每页最大可请求80个item。默认为20,所以能减少1/4的http请求;

## 3.9.3(2020-12-21)
* bugfix
- 应该用总量除以80,而不是总页数除以80……

2 changes: 1 addition & 1 deletion src/crawl/item_crawler.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def crawl_goods_by_price_section(category=None):

# 使用80一页后,新的页码
if use_max_page_size:
total_page = math.ceil(total_page / max_page_size)
total_page = math.ceil(total_count / max_page_size)

log.info('Totally {} items of {} pages to crawl.'.format(total_count, total_page))
# get each page
Expand Down

0 comments on commit be1425f

Please sign in to comment.