0
我需要选择根的兄弟姐妹,并且仅用于第一级。XPath选择兄弟父母为根文档的兄弟姐妹
我选择HTML,它可以是点儿......
例如:
什么我tryed是这样/*[following-sibling::*]
但只选择两个<p><img...></p>
...
我想要的是选择PP ul a中的第一级。
林期运用的Html Agillity包和我的代码如下所示:
var nodeCollection = new List<HtmlNode>();
var document = new HtmlDocument();
document.LoadHtml(html);
if (document.DocumentNode != null)
{
foreach (var node in document.DocumentNode.SelectNodes("/*[following-sibling::*]"))
{
nodeCollection.Add(node);
}
任何人都知道什么即时做错了什么?