wangkun 1 year ago
parent
commit
286af7e7df
1 changed files with 3 additions and 2 deletions
  1. 3 2
      shipinhao/shipinhao_search/shipinhao_search.py

+ 3 - 2
shipinhao/shipinhao_search/shipinhao_search.py

@@ -252,7 +252,7 @@ class ShipinhaoSearch:
                     Common.logger(log_type, crawler).info('切换到视频号 webview 成功')
                     return "成功"
             except Exception as e:
-                Common.logger(log_type, crawler).info(f"{e}\n")
+                Common.logger(log_type, crawler).info(f"切换失败")
 
     @classmethod
     def repeat_out_video_id(cls, log_type, crawler, out_video_id, env):
@@ -335,7 +335,8 @@ class ShipinhaoSearch:
                     if len(video_element.find_elements(By.XPATH, "//*[@text='没有更多的搜索结果']")) != 0:
                         Common.logger(log_type, crawler).info("没有更多的搜索结果\n")
                         return
-                    video_title = video_element.find_elements(By.XPATH, '//div[@class="title ellipsis_2"]/*[2]')[index + i].text[:40]
+                    # video_title = video_element.find_elements(By.XPATH, '//div[@class="title ellipsis_2"]/*[2]')[index + i].text[:40]
+                    video_title = video_element.find_elements(By.XPATH, '//div[@class="rich-media__title ellipsis_2"]/span')[index + i].text[:40]
                     video_url = video_element.find_elements(By.XPATH, '//div[@class="video-player"]')[index+i].get_attribute('src')
                     cover_url = video_element.find_elements(By.XPATH, '//div[@class="video-player__bd"]')[index+i].get_attribute('style')
                     cover_url = cover_url.split('url("')[-1].split('")')[0]