wangkun 2 rokov pred
rodič
commit
1615c6a96c

+ 1 - 1
common/common.py

@@ -41,7 +41,7 @@ class Common:
 
         # 日志文件名
         # log_name = time.strftime("%Y-%m-%d", time.localtime(time.time())) + f'-{crawler}-{log_type}.log'
-        log_name = f'{date.today()}-{crawler}-{log_type}.log'
+        log_name = str(date.today()) + f"-{crawler}-{log_type}.log"
 
         # 日志不打印到控制台
         logger.remove(handler_id=None)

+ 7 - 7
shipinhao/shipinhao_search/shipinhao_search.py

@@ -246,13 +246,13 @@ class ShipinhaoSearch:
         windowHandles = driver.window_handles
         for handle in windowHandles:
             driver.switch_to.window(handle)
-            try:
-                shipinhao_webview = driver.find_element(By.XPATH, '//div[@class="unit"]')
-                if shipinhao_webview:
-                    Common.logger(log_type, crawler).info('切换到视频号 webview 成功')
-                    return "成功"
-            except Exception as e:
-                Common.logger(log_type, crawler).info(f"切换失败")
+            # try:
+            shipinhao_webview = driver.find_element(By.XPATH, '//div[@class="unit"]')
+            if shipinhao_webview:
+                Common.logger(log_type, crawler).info('切换到视频号 webview 成功')
+                return "成功"
+            # except Exception as e:
+            #     Common.logger(log_type, crawler).info(f"切换失败")
 
     @classmethod
     def repeat_out_video_id(cls, log_type, crawler, out_video_id, env):