click_share_video.py 728 B

1234567891011121314151617181920212223242526
  1. # -*- coding: utf-8 -*-
  2. # @Author: wangkun
  3. # @Time: 2022/9/1
  4. from appium import webdriver
  5. from selenium.webdriver.common.by import By
  6. class Click:
  7. @classmethod
  8. def click_video(cls):
  9. desired_caps = {'app': r"C:\Program Files (x86)\Tencent\WeChat\WeChat.exe"}
  10. driver = webdriver.Remote(
  11. command_executor='http://127.0.0.1:4723',
  12. desired_capabilities=desired_caps)
  13. driver.implicitly_wait(10)
  14. driver.find_element(By.NAME, '爬虫群').click()
  15. msg_list = driver.find_elements(By.NAME, '消息')
  16. msg = msg_list[-1]
  17. title = msg.get_attribute('name')
  18. print(title)
  19. msg.click()
  20. if __name__ == '__main__':
  21. Click.click_video()