1

I'm try to get the video src link from site. However webbrowser.documenttext only retrieved source code of the website, which does not included the change made to a video tag after javascript render.

For example: When you get a document text or just a simple webclient request you get the following text for their video tag Screenshot from View-Source

As you see, it has a

<video id="my_play" class="video-js vjs-theme-colors-blue vjs-paused vjs-fluid" controls preload="auto" data-setup='{"techOrder": ["html5", "flash"]}'>
    <p class="vjs-no-js">To view this video please enable JavaScript, and consider upgrading to a web browser that <a href="http://videojs.com/html5-video-support/" target="_blank">supports HTML5 video</a></p>
  </video>

However if you do developer tools, which (I believe) is render by javascript, the video tag is changed to have the src attribute. Screenshot from Dev Tool

That highlight src attribute in second screenshot is the address I need to get. Any suggestion on how to retrieved that link?

Chochu
  • 23
  • 4
  • 1
    My comment about this likely violating the TOS of the site in question doesn't become any less relevant now that you have blanked out the name of the site... – Dark Falcon Jul 11 '17 at 15:44

1 Answers1

0

You can use Gecko browser to load the site. Once the site done loading(Use DocumentCompleted event), you can execute the code below to retrieve the src attribute

GeckoHtmlElement ele;
ele = geckoWebBrowser1.Document.GetHtmlElementById("myData");
MessageBox.Show(ele.GetAttribute("Value"));
Bonobo
  • 26
  • 6