|
@@ -26,6 +26,7 @@ from common.scheduling_db import MysqlHelper
|
|
|
|
|
|
class HTZFRecommend:
|
|
|
platform = "海豚祝福"
|
|
|
+ i = 0
|
|
|
element_list = []
|
|
|
|
|
|
@classmethod
|
|
@@ -149,6 +150,8 @@ class HTZFRecommend:
|
|
|
Common.logger(log_type, crawler).info(f"正在抓取第{page+1}页")
|
|
|
if cls.search_elements(driver, '//*[@class="list"]') is None:
|
|
|
Common.logger(log_type, crawler).info("列表页窗口已销毁\n")
|
|
|
+ cls.element_list = []
|
|
|
+ cls.i = 0
|
|
|
return
|
|
|
for i in range(1):
|
|
|
cls.swipe_up(driver)
|
|
@@ -177,8 +180,11 @@ class HTZFRecommend:
|
|
|
today_download = cls.today_download_cnt(log_type, crawler, env)
|
|
|
if today_download >= videos_cnt:
|
|
|
Common.logger(log_type, crawler).info(f"今日已下载视频数:{today_download}")
|
|
|
+ cls.element_list = []
|
|
|
+ cls.i = 0
|
|
|
return
|
|
|
- Common.logger(log_type, crawler).info(f"第{i+1}条视频")
|
|
|
+ cls.i += 1
|
|
|
+ Common.logger(log_type, crawler).info(f"第{cls.i}条视频")
|
|
|
video_title = video_element.find("wx-view", class_="title").text
|
|
|
play_str = video_element.find("wx-view", class_="wan").text
|
|
|
play_cnt = int(re.sub(r"\D", "", play_str)) * 10000 if "万" in play_str else play_str
|