|
@@ -567,7 +567,7 @@ class XiguasearchScheduling:
|
|
|
Common.logger(log_type, crawler).info(f"打开搜索页:{user_dict['link']}")
|
|
|
Common.logging(log_type, crawler, env, f"打开搜索页:{user_dict['link']}")
|
|
|
driver.get(f"https://www.ixigua.com/search/{user_dict['link']}/")
|
|
|
- time.sleep(3)
|
|
|
+ time.sleep(2)
|
|
|
Common.logger(log_type, crawler).info("关闭登录弹框")
|
|
|
Common.logging(log_type, crawler, env, "关闭登录弹框")
|
|
|
if driver.find_elements(By.XPATH, '//*[@class="xg-notification-close"]') != 0:
|
|
@@ -579,12 +579,11 @@ class XiguasearchScheduling:
|
|
|
Common.logger(log_type, crawler).info("点击最新排序")
|
|
|
Common.logging(log_type, crawler, env, "点击最新排序")
|
|
|
driver.find_element(By.XPATH, '//*[@class="searchPageV2__header-categories-wrapper"]/*[1]/*[2]/*[1]').click()
|
|
|
- time.sleep(3)
|
|
|
+ time.sleep(1)
|
|
|
# driver.get_screenshot_as_file(f"./{crawler}/photos/{user_dict['link']}-最新排序.png")
|
|
|
Common.logger(log_type, crawler).info("收起筛选按钮\n")
|
|
|
Common.logging(log_type, crawler, env, "收起筛选按钮\n")
|
|
|
driver.find_element(By.XPATH, '//*[@class="searchPageV2__header-icons-categories"]').click()
|
|
|
- time.sleep(1)
|
|
|
|
|
|
index = 0
|
|
|
num = 0
|
|
@@ -614,7 +613,7 @@ class XiguasearchScheduling:
|
|
|
Common.logger(log_type, crawler).info(f'拖动"视频"列表第{num}个至屏幕中间')
|
|
|
Common.logging(log_type, crawler, env, f'拖动"视频"列表第{num}个至屏幕中间')
|
|
|
driver.execute_script("arguments[0].scrollIntoView({block:'center',inline:'center'})", video_element)
|
|
|
- time.sleep(3)
|
|
|
+ time.sleep(1)
|
|
|
# driver.get_screenshot_as_file(f"./{crawler}/photos/{user_dict['link']}-{num}.png")
|
|
|
title = video_element.find_elements(By.XPATH, '//*[@class="HorizontalFeedCard__coverWrapper disableZoomAnimation"]')[index+i-1].get_attribute('title')
|
|
|
publish_day = video_element.find_elements(By.XPATH, '//*[@class="HorizontalFeedCard-accessories-bottomInfo__statistics"]')[index+i-1].text.split('· ')[-1]
|