2024-10-03 00:19:03 发布
网友
我正在尝试从该页面查找预告片视频的urlhttps://www.binged.com/streaming-premiere-dates/black-monday/
我检查了div class="wordkeeper-video"的各种属性,找不到它。有人能帮忙吗
div class="wordkeeper-video"
视频href最初不在那里。 您需要首先单击播放按钮(实际上是图像),然后href显示在那里的iframe中。 {}是{} 因此,您必须切换到iframe,然后提取它的src属性
href
iframe
src
完整的URL不在那里,但您只需要构建它
<div class="wordkeeper-video " data-type="youtube" data-embed="pzxGR6Q-7Mc" ...>
data-embed属性具有您需要的功能
data-embed
网址是
https://www.youtube.com/watch?v=pzxGR6Q-7Mc ^ here's the data-embed value
你可以通过使用
data_embed = driver.find_element_by_css_selector(".wordkeeper-video").get_attribute("data-embed") video_url = "https://www.youtube.com/watch?v=" + data_embed
去玩吧。然后会有这样的事情。链接位于src标记中
<iframe frameborder="0" allowfullscreen="" allow="autoplay" src="https://www.youtube.com/embed/pzxGR6Q-7Mc?rel=0&showinfo=0&autoplay=1"></iframe>
PS:它在div class="wordkeeper-video"
视频}是{}
因此,您必须切换到
href
最初不在那里。 您需要首先单击播放按钮(实际上是图像),然后href
显示在那里的iframe
中。{
iframe
,然后提取它的src
属性完整的URL不在那里,但您只需要构建它
data-embed
属性具有您需要的功能网址是
你可以通过使用
去玩吧。然后会有这样的事情。链接位于
src
标记中PS:它在
div class="wordkeeper-video"
相关问题 更多 >
编程相关推荐