简体   繁体   中英

how to get url from video element through axios request

Here I am trying to get URL from video element but didn't get

Here when I fire this URL https://www.instagram.com/reel/CYd4S2Wrbtg/ in browser then in inspect I am getting video element something like this:

<video class="tWeCl" crossorigin="anonymous" playsinline="" poster="https://instagram.fstv5-1.fna.fbcdn.net/v/t51.2885-15/e35/271364026_966285387645021_6833216126146124934_n.jpg?_nc_ht=instagram.fstv5-1.fna.fbcdn.net&amp;_nc_cat=1&amp;_nc_ohc=6A2H8WVShtIAX_5F_BN&amp;edm=APfKNqwBAAAA&amp;ccb=7-4&amp;oh=00_AT_-QPwnrPdiefyGa2Y49blLeFbXwPLbZSzisyfuYzkXew&amp;oe=61F3EC67&amp;_nc_sid=74f7ba" preload="none" type="video/mp4" src="https://instagram.fstv5-1.fna.fbcdn.net/v/t50.2886-16/271301651_128273096347718_8827368247380350189_n.mp4?_nc_ht=instagram.fstv5-1.fna.fbcdn.net&amp;_nc_cat=102&amp;_nc_ohc=2X_ChX5ekQkAX8miWrl&amp;edm=APfKNqwBAAAA&amp;ccb=7-4&amp;oe=61F39C7E&amp;oh=00_AT-kSFHSGw1RST72G1xAT1lQ3CO_3BnibPHZUBtVURjbUQ&amp;_nc_sid=74f7ba"></video>

but when I try to get this video element using Axios request I am not getting

axios.get('https://www.instagram.com/reel/CYd4S2Wrbtg/').then(html => {
   console.log(html.data, 'r+++++++++++++++') 
   res.send(html.data);
}); 

I think the video element is not in the source of the page. What I mean to say is the video element is created using javascript after the body is mounted, which means when you hit a get request you get a basic HTML file with loads of javascript which renders the video later. So in a way, the video element doesn't exist when you hit a get request.

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