wangkun 1 vuosi sitten
vanhempi
commit
d2920f2989

+ 4 - 0
scheduling/scheduling_v3/crawler_scheduling_v3.py

@@ -96,6 +96,10 @@ class SchedulingV3:
             mode = "author4"
         elif "gongzhonghao5" in spider_name:
             mode = "author5"
+        elif "xiaoniangao_play" in spider_name:
+            mode = "play"
+        elif "xiaoniangao_hour" in spider_name:
+            mode = "hour"
         else:
             mode = mode
 

+ 5 - 5
xigua/xigua_search/xigua_search_new.py

@@ -672,15 +672,15 @@ class XiguaSearchNew:
         driver.implicitly_wait(10)
         Common.logger(log_type, crawler).info(f"打开搜索页:{search_word}")
         driver.get(f"https://www.ixigua.com/search/{search_word}/")
-        time.sleep(1)
+        time.sleep(3)
         if len(driver.find_elements(By.XPATH, '//*[@class="xg-notification-close"]')) != 0:
             driver.find_element(By.XPATH, '//*[@class="xg-notification-close"]').click()
         Common.logger(log_type, crawler).info("点击筛选")
         driver.find_element(By.XPATH, '//*[@class="searchPageV2__header-icons-categories"]').click()
-        time.sleep(0.5)
+        time.sleep(1)
         Common.logger(log_type, crawler).info("点击最新排序")
         driver.find_element(By.XPATH, '//*[@class="searchPageV2-category__wrapper"]/*[2]/*[1]').click()
-        time.sleep(1)
+        time.sleep(5)
 
         index = 0
         while True:
@@ -743,8 +743,8 @@ class XiguaSearchNew:
                 except Exception as e:
                     Common.logger(log_type, crawler).warning(f"抓取单条视频异常:{e}\n")
 
-            Common.logger(log_type, crawler).info('已抓取完一组视频,休眠3秒\n')
-            time.sleep(3)
+            Common.logger(log_type, crawler).info('已抓取完一组视频,休眠10秒\n')
+            time.sleep(10)
             index = index + len(video_element_temp)
 
     @classmethod

+ 4 - 4
xigua/xigua_search/xigua_search_scheduling.py

@@ -566,7 +566,7 @@ class XiguasearchScheduling:
         driver.implicitly_wait(10)
         Common.logger(log_type, crawler).info(f"打开搜索页:{user_dict['nick_name']}")
         driver.get(f"https://www.ixigua.com/search/{user_dict['nick_name']}/")
-        time.sleep(1)
+        time.sleep(3)
         # driver.get_screenshot_as_file(f"./{crawler}/logs/打开搜索页.jpg")
         if len(driver.find_elements(By.XPATH, '//*[@class="xg-notification-close"]')) != 0:
             driver.find_element(By.XPATH, '//*[@class="xg-notification-close"]').click()
@@ -576,7 +576,7 @@ class XiguasearchScheduling:
         time.sleep(1)
         Common.logger(log_type, crawler).info("点击最新排序")
         driver.find_element(By.XPATH, '//*[@class="searchPageV2-category__wrapper"]/*[2]/*[1]').click()
-        time.sleep(1)
+        time.sleep(5)
         # driver.get_screenshot_as_file(f"./{crawler}/logs/已点击最新排序.jpg")
 
         index = 0
@@ -635,8 +635,8 @@ class XiguasearchScheduling:
                 except Exception as e:
                     Common.logger(log_type, crawler).warning(f"抓取单条视频异常:{e}\n")
 
-            Common.logger(log_type, crawler).info('已抓取完一组视频,休眠3秒\n')
-            time.sleep(3)
+            Common.logger(log_type, crawler).info('已抓取完一组视频,休眠10秒\n')
+            time.sleep(10)
             index = index + len(video_element_temp)
 
     @classmethod