diff --git a/docs/api/taobao/taobao.md b/docs/api/taobao/taobao.md index 6a7b5bf..9916893 100644 --- a/docs/api/taobao/taobao.md +++ b/docs/api/taobao/taobao.md @@ -132,6 +132,8 @@ | 参数 | 必选 | 类型 | 说明 | |:---:|:---:|:---:|:---:| | id | true | string | 商品id | +| offset | false | int | 评论翻页偏移量, 默认0 | +| limit | false | int | 评论数量, 默认20 | - **Success Response** diff --git a/service/taobao/logic/search.py b/service/taobao/logic/search.py index 194901e..97ebb52 100644 --- a/service/taobao/logic/search.py +++ b/service/taobao/logic/search.py @@ -18,8 +18,8 @@ async def request_search(keyword: str, cookie: str, offset: int = 0, limit: int total = 0 tasks = [search(keyword, cookie, page) for page in range(start_page, end_page + 1)] - results = await asyncio.gather(*tasks) - for data in results: + task_results = await asyncio.gather(*tasks) + for data in task_results: results.extend(data.get('itemsArray', [])) total = data.get('mainInfo', {}).get('totalResults', 0)