简体   繁体   English

如何使用 selenium 找到隐藏的视频源?

[英]how to find hidden video src using selenium?

In general, It is possible to download the video by right-click.通常,可以通过右键单击来下载视频。 But I don't know how to find this video's src using selenium.但是我不知道如何使用 selenium 找到这个视频的 src。

<div id="video-processing" class="video-processing hidden">Processing video, please check back in a while</div>
<video id="video-player" class="video-js vjs-default-skin hidden" controls preload="auto" width="640" height="264" poster="http://i3.ruliweb.com/profile/16/12/01/158b9f7cb02326425.jpeg"></video>

I needs your help.我需要你的帮助。 thanks.谢谢。

I had a problem like your question, If you can not find the src by Inspect by browser Or get the page source code by Python (For various reasons, such as controlling several quality of video or for security & police reasons) ➡ One hundred percent is being changed by JavaScript. Otherwise should have been visible in the HTML code.我有一个问题像你的问题,如果你不能通过浏览器检查找到源代码或者通过src获取页面源代码(出于各种原因,例如控制多个视频质量或出于安全和警察原因)➡ 百分百正在被 JavaScript 更改。否则应该在HTML代码中可见。 So I have a very simple recommendation and that is to use this code in Console:所以我有一个非常简单的建议,那就是在控制台中使用这段代码:

var x = document.getElementsById("video-player").getAttribute("src");
console.log(x);
alert(x);

Of course, it would be much better if you give the site Address.当然,如果给个站点地址就更好了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM