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 Agility Pack 做到这一点?有更好的方法吗?
<li>
<li>标签中包含的唯一内容是事实,仅此而已。
就像是:
List<string> facts = new List<string>(); foreach (HtmlNode li in doc.DocumentNode.SelectNodes("//li")) { facts.Add(li.InnerText); }