I'm testing out Selenium's html5 video automation methods, I can't find one to jump a certain amount of time for current location in the video.
driver = webdriver.Firefox()
driver.get("https://www.youtube.com/watch?v=v_I4zqC7GN8")
driver.execute_script('document.getElementsByTagName("video")[0].currentTime=30
allows me to jump to the 30-second time mark.
However, I want to jump 30-seconds from my current time position.
Most tutorials are in java, with some getting really deep into java code -- I'm unfamiliar with Java.
You just need to add 30
to the current currentTime
value:
document.getElementsByTagName("video")[0].currentTime += 30;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With