如何从 C# HtmlagilityPack 中的网页读取特定视频标签

How to read the specific video tags from a webpage in c# HtmlagilityPack

我需要使用 Htmlagilitypack 读取视频标签文件中的源代码 src="/~/media/7ca037b0700844cd92db1fe753a4abfc.ashx"。如何使用 Htmlagilitypack 阅读它。

  <video src="/~/media/7ca037b0700844cd92db1fe753a4abfc.ashx" id="video-e054fd59c68443fa928282dc407ff186" class="mediaelement">
          <source type="video/mp4" src="/~/media/7ca037b0700844cd92db1fe753a4abfc.ashx" title="720p HD">
          <source type="video/webm" src="/~/media/5ab38b9c889d43e4a287f6b83c988133.ashx" title="720p HD">
    </video>

这是我的代码

HtmlAgilityPack.HtmlDocument document = htmlWeb.Load("http://www.volvocars.com/us/cars/new-models/xc60");
                HtmlNode someNode = document.GetElementbyId("video");

                if (someNode != null)
                {
                    IEnumerable<HtmlNode> allLinks = someNode.Descendants("a");

                    foreach (HtmlNode link in allLinks)
                    {
                        if (link.Attributes.Contains("src"))
                        {
                            if (link.Attributes["src"].Value.StartsWith("source"))
                                Console.WriteLine(link.Attributes["src"].Value);
                        }
                    }
                }

使用GetElementsByTagName代替GetElementById