处理HTML5视频播放.py

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)

相关推荐