如何获取特定的标签?

How to get a specific a tag?

我正在使用 HtmlAgilityPack 并且我正在尝试获取一个特定的 a 标签,其中包含一个特定的文本。 假设我有这个 html 结构:

<ul>
    <li class="current">
        <a href="/matches/2018/05/20/italy/serie-a/ss-lazio-roma/fc-internazionale-milano/2539153/">Summary</a>
    </li>
    <li class="">
        <a href="/matches/2018/05/20/italy/serie-a/ss-lazio-roma/fc-internazionale-milano/2539153/head2head/">H2H Comparison</a>
    </li>
    <li class="">
        <a href="/matches/2018/05/20/italy/serie-a/ss-lazio-roma/fc-internazionale-milano/2539153/commentary/">Commentary</a>
    </li>
    <li class=""><a href="/matches/2018/05/20/italy/serie-a/ss-lazio-roma/fc-internazionale-milano/2539153/venue/">Venue</a>
    </li>
    <li class="">
        <a href="/matches/2018/05/20/italy/serie-a/ss-lazio-roma/fc-internazionale-milano/2539153/map/">Map</a>
    </li>
</ul>

我想要获取包含 InnerText: "Venue" 的 a 标签。 其实我的想法是这样的:

var nodes = nodes.SelectNodes("//li//a");
HtmlNode a;

foreach(var node in nodes)
{
   if(node.InnerText.ToLower().Contains("venue"))
   {
       a = node;
       break;
   }
}

这是有效的代码,但存在另一种方式,可能使用 xpath 或类似的东西?

这将 return 所有包含单词 "Venue" //a[contains(text(),'Venue')]

的锚标记