还未实现 部分FLASh 页面播放 欢迎大佬帮忙完善,谢谢!
[Python] 纯文本查看 复制代码from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.common.by import By
#import requests
from time import sleep
# 创建 WebDriver 对象,指明使用chrome浏览器驱动
wd = webdriver.Chrome(service=Service(r'C:\Program Files\Google\Chrome\Application\chromedriver.exe'))
#wd = webdriver.Chrome()
# 调用WebDriver 对象的get方法 可以让浏览器打开指定网址
wd.get('https://wwwXXX.gov.cn/index.html')
sleep(5)
elements = wd.find_element(By.XPATH, "/html/body/div[3]/a[1]").click()
sleep(3)
elements = wd.find_element(By.XPATH, "//*[@id='username']")
elements.click()
elements.send_keys('你的账号')
sleep(3)
elements = wd.find_element(By.XPATH, '//*[@id="pwd"]')
elements.click()
elements.send_keys ('你的密码')
elements = wd.find_element(By.XPATH, "/html/body/div[2]/div/div[2]/form/div[3]/input").click()
sleep(5)
wd.get('https://www.XXX.gov.cn/student/course_myselect.do?searchType=2&menu=course')
sleep(5)
#循环N次播放视频
i = 1
while i