Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
按照这个例子,我可以找到 LI 部分。
Html 敏捷包 - 解析 <li>
但是,我只想要位于 div 内的 LI 项目,其 id 为“res”。
我怎么做?
像这样的东西:
List facts = new List(); foreach (HtmlNode li in doc.DocumentNode.SelectNodes("//div[@id='res']/li")) { facts.Add(li.InnerText); }