处理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)
相关推荐
WebVincent 2020-06-06
行吟阁 2020-04-10
ShoppingChen 2020-06-25
冰蝶 2020-01-08
Jym 2012-07-05
tumobi 2016-12-08
一点一刻 2013-09-17
HandsomeHong 2010-08-13
Charliewolf 2019-11-10
WenFY的CSDN 2019-10-24
89510194 2019-10-22
nercon 2019-10-20
行吟阁 2019-10-22
zhangli 2014-11-12
jadechen00 2014-11-08