如何检查主页中的视频是否自动播放和无限循环? 我需要在开放测试中的代码,可以使用java,javascript或python进行硒
这篇文章需要更多信息,但是如果我假设您正在谈论html中的<video>
,则可以执行类似操作。(这个例子是用Python写的(
# autoplay attribute doesn't have a value attached to it
# so you'll have to find it with a css selector
try:
# If it finds the element it is autoplay.
video = driver.find_element_by_css_selector('video[autoplay]')
except:
pass # Video is not autoplay.