简体   繁体   中英

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.

<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. 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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