处理HTML5视频播放.py

爱好HtmlCssJs 2020-01-18

from selenium import webdriverfrom time import sleepdriver = webdriver.Firefox()driver.get("http://videojs.com")video = driver.find_element_by_xpath("body/Setion[1]/div/video")#返回播放文件地址url = driver.execute_script("return arguments[0].currentSrc;",video)print(url)#播放视频print("start")driver.execute_script("return arguments[0].play()",video)#播放15秒sleep(15)#暂停视频print("stop")driver.execute_script("arguments[0].pause()",video)

相关推荐

Kingcxx / 0评论 2020-03-07