I'm trying to use HtmlAgilityPack for parsing a web page information. This is my code:
using System;
using HtmlAgilityPack;
namespace htmparsing
{
class MainClass
{
public static void Main (string[] args)
{
string url = "https://bugs.eclipse.org";
HtmlWeb web = new HtmlWeb();
HtmlDocument doc = web.Load(url);
foreach(HtmlNode node in doc){
//do something here with "node"
}
}
}
}
But when I tried to access to doc.DocumentElement.SelectNodes
I can not see DocumentElement
in the list. I added the HtmlAgilityPack.dll in the references, but I don't know what's the problem.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…