python爬取视频自动播放_求助该网站如何让它能自动播放下一个视频。。。醉了,要挂80个课时...

发布于:2023-07-27 ⋅ 阅读:(122) ⋅ 点赞:(0)

[Python] 纯文本查看 复制代码#-*- coding:utf-8 -*-

from selenium import webdriver

import time

import re

"""---------打开谷歌浏览器进行selenium自动化测试--------"""

chromedriver = 'chromedriver.exe'

chome_options = webdriver.ChromeOptions()

wd = webdriver.Chrome(chromedriver, chrome_options=chome_options)

wd.delete_all_cookies() # 删除cookies

wd.maximize_window() # 将浏览器最大化

wd.implicitly_wait(120)

"""------------------以上代码不需要改动-----------------"""

"""------------------自动登录-----------------"""

wd.get("http://start.lgb360.com/video.html")# 调用WebDriver 对象的get方法 让浏览器打开刷课网址

print("正在自动登录!")

element = wd.find_element_by_xpath("/html/body/div/div[2]/div/div[1]/span[2]") #账户登录按钮

element.click() #单击

element = wd.find_element_by_xpath("/html/body/div


网站公告

今日签到

点亮在社区的每一天
去签到