代码之家  ›  专栏  ›  技术社区  ›  Darth Continent

使用HTMLAgilityPack从HTMLNode提取URL的XPath语法?

  •  0
  • Darth Continent  · 技术社区  · 15 年前

    XPath href公司 属性 HTML节点 :

    <a target="_blank" class="monkeys" href="http://someurl.com" id="123">
        <span class="title">Monkeys are flying all over!</span>
    </a> 
    
    2 回复  |  直到 15 年前
        1
  •  3
  •   ase    15 年前
    //a[@id='123']/@href
    

    对我有用。

        2
  •  0
  •   LesterDove    15 年前

    //a@href 你在找什么?

    HTMLAgilityPack.HTMLNode.GetAttributeValue("href", "")