|
@@ -95,24 +95,20 @@ class Recommend:
|
|
|
try:
|
|
|
driver.implicitly_wait(10)
|
|
|
for i in range(10):
|
|
|
- # 关闭页面弹窗
|
|
|
- try:
|
|
|
- driver.find_element(By.XPATH, '//*[@text="我知道了"]').click()
|
|
|
- driver.find_element(By.XPATH, '//*[@text="知道了"]').click()
|
|
|
- Common.logger(log_type).info('已关闭未成年模式弹窗')
|
|
|
- except NoSuchElementException:
|
|
|
- pass
|
|
|
-
|
|
|
- try:
|
|
|
- driver.find_element(By.ID, 'com.tencent.mm:id/dkf')
|
|
|
- Common.logger(log_type).info('直播视频,向上滑动页面\n')
|
|
|
- driver.swipe(500, 1500, 500, 500, 300)
|
|
|
- except NoSuchElementException:
|
|
|
- pass
|
|
|
-
|
|
|
- # Common.logger(log_type).info('暂停播放')
|
|
|
- pause_btn = driver.find_element(By.ID, 'com.tencent.mm:id/eh4')
|
|
|
- pause_btn.click()
|
|
|
+ # # 关闭页面弹窗
|
|
|
+ # try:
|
|
|
+ # driver.find_element(By.XPATH, '//*[@text="我知道了"]').click()
|
|
|
+ # driver.find_element(By.XPATH, '//*[@text="知道了"]').click()
|
|
|
+ # Common.logger(log_type).info('已关闭未成年模式弹窗')
|
|
|
+ # except NoSuchElementException:
|
|
|
+ # pass
|
|
|
+ #
|
|
|
+ # try:
|
|
|
+ # driver.find_element(By.ID, 'com.tencent.mm:id/dkf')
|
|
|
+ # Common.logger(log_type).info('直播视频,向上滑动页面\n')
|
|
|
+ # driver.swipe(500, 1500, 500, 500, 300)
|
|
|
+ # except NoSuchElementException:
|
|
|
+ # pass
|
|
|
|
|
|
# 视频标题
|
|
|
try:
|
|
@@ -120,8 +116,12 @@ class Recommend:
|
|
|
video_title = title_id.get_attribute('name')
|
|
|
except NoSuchElementException:
|
|
|
video_title = ''
|
|
|
+ driver.swipe(500, 1500, 500, 500, 300)
|
|
|
|
|
|
# 点击播放器,获取视频时长
|
|
|
+ # Common.logger(log_type).info('暂停播放')
|
|
|
+ pause_btn = driver.find_element(By.ID, 'com.tencent.mm:id/eh4')
|
|
|
+ pause_btn.click()
|
|
|
start_time = driver.find_element(By.ID, 'com.tencent.mm:id/l59').get_attribute('name')
|
|
|
start_time = int(start_time.split(':')[0])*60 + int(start_time.split(':')[-1])
|
|
|
try:
|