Parsing HTML Reading Option Tag Content with HtmlAgillityPack

前端 未结 3 755
旧巷少年郎
旧巷少年郎 2020-12-06 22:52

I am trying to use HtmlAgilityPack to parse HTML, but am having problems.

Sample HTML Doc:


  

        
3条回答
  •  广开言路
    2020-12-06 23:27

    You should use:

    selectNode.SelectNodes("option");
    

    instead of:

    selectNode.SelectNodes("//option");
    

    or you are starting your XPath expression from the root of the HTML document.

提交回复
热议问题