标签:selenium ret art html5视频 firefox VID sele turn sleep
from selenium import webdriver
from time import sleep
driver = 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)
标签:selenium ret art html5视频 firefox VID sele turn sleep
原文地址:https://www.cnblogs.com/zhang-da/p/12210635.html