积极答复者
HtmlAgilityPack识别不了<>这个尖括号

问题
-
如果我的html页面有一个段落是
<p><></p>
在浏览器上可以正常显示<>出来
但是为什么用
static List<string> FindText(string str) { List<string> texts = new List<string>(); HtmlAgilityPack.HtmlDocument doc = new HtmlDocument(); doc.LoadHtml(str); foreach ( HtmlNode temp in doc.DocumentNode.SelectNodes("//p")) { texts.Add(temp.InnerText.Trim()); } return texts; }
去发现该节点的 innerText ==""
是空的字符串,这是不是htmlAgilityPack.dll的一个bug啊??好像除了<>别的字符都可以读出来,我要怎么使用htmlAgilityPack.dll才能读出一个段落<p>的正确内容??
补充:<p>没有id,不能用getNodeByID