feat: xhs支持获取评论的点赞数量

This commit is contained in:
Relakkes
2024-08-24 06:07:33 +08:00
parent ab7d8142af
commit 65699aa1cb
4 changed files with 65 additions and 1 deletions

View File

@@ -6,6 +6,7 @@ from typing import Dict, List, Optional, Tuple
from playwright.async_api import (BrowserContext, BrowserType, Page,
async_playwright)
from tenacity import RetryError
import config
from base.base_crawler import AbstractCrawler
@@ -197,6 +198,9 @@ class XiaoHongShuCrawler(AbstractCrawler):
utils.logger.error(
f"[XiaoHongShuCrawler.get_note_detail_from_html] have not fund note detail note_id:{note_id}, err: {ex}")
return {}
except RetryError as ex:
utils.logger.error(
f"[XiaoHongShuCrawler.get_note_detail_from_html] Retry error, note_id:{note_id}, err: {ex}")
get_note_detail_task_list = [
get_note_detail_from_html_task(note_id=note_id, semaphore=asyncio.Semaphore(config.MAX_CONCURRENCY_NUM)) for