|
@@ -16,6 +16,7 @@ from selenium.webdriver.common.by import By
|
|
import multiprocessing
|
|
import multiprocessing
|
|
|
|
|
|
from common import AliyunLogger
|
|
from common import AliyunLogger
|
|
|
|
+from common.feishu import Feishu
|
|
from common.public import clean_title, get_config_from_mysql
|
|
from common.public import clean_title, get_config_from_mysql
|
|
|
|
|
|
sys.path.append(os.getcwd())
|
|
sys.path.append(os.getcwd())
|
|
@@ -192,12 +193,11 @@ class XiaoNianGaoPlusRecommend:
|
|
|
|
|
|
video_mid_elements = self.search_elements("//wx-view[@class='bar--navBar-content-capsule-wrap']")
|
|
video_mid_elements = self.search_elements("//wx-view[@class='bar--navBar-content-capsule-wrap']")
|
|
mid = int(video_mid_elements[0].get_attribute("data-mid"))
|
|
mid = int(video_mid_elements[0].get_attribute("data-mid"))
|
|
- repeat_video_id= self.repeat_video_id(mid)
|
|
|
|
- if repeat_video_id != 0:
|
|
|
|
|
|
+ repeat_video_id = self.repeat_video_id(mid)
|
|
|
|
+ if repeat_video_id:
|
|
Common.logger(self.log_type, self.crawler).info(f"该用户已经存在")
|
|
Common.logger(self.log_type, self.crawler).info(f"该用户已经存在")
|
|
# status = 0
|
|
# status = 0
|
|
# self.insert_user(mid, user_name, data_list, status)
|
|
# self.insert_user(mid, user_name, data_list, status)
|
|
-
|
|
|
|
self.driver.press_keycode(AndroidKey.BACK)
|
|
self.driver.press_keycode(AndroidKey.BACK)
|
|
return
|
|
return
|
|
|
|
|
|
@@ -212,7 +212,13 @@ class XiaoNianGaoPlusRecommend:
|
|
formatted_time = time.strftime("%Y-%m-%d", localtime)
|
|
formatted_time = time.strftime("%Y-%m-%d", localtime)
|
|
print(formatted_time)
|
|
print(formatted_time)
|
|
self.insert_user(mid, user_name, data_list, status, formatted_time)
|
|
self.insert_user(mid, user_name, data_list, status, formatted_time)
|
|
- Common.logger(self.log_type, self.crawler).info(f"{mid}:{user_name}入库")
|
|
|
|
|
|
+ values = [[
|
|
|
|
+ mid, user_name, formatted_time, data_list
|
|
|
|
+ ]]
|
|
|
|
+ Feishu.insert_columns('xiaoniangao', 'xiaoniangao', "8zlceR", "ROWS", 1, 2)
|
|
|
|
+ time.sleep(0.5)
|
|
|
|
+ Feishu.update_values('xiaoniangao', 'xiaoniangao', "8zlceR", "A2:Z2", values)
|
|
|
|
+ Common.logger(self.log_type, self.crawler).info(f"{mid}:{user_name}写入成功")
|
|
AliyunLogger.logging(
|
|
AliyunLogger.logging(
|
|
code="1010",
|
|
code="1010",
|
|
platform=self.platform,
|
|
platform=self.platform,
|