HttpHelper http = new HttpHelper();
HttpItem item = new HttpItem() { URL = "http://www.sufeinet.com" };
HtmlDocument html = new HtmlDocument();
html.LoadHtml(http.GetHtml(item));
HtmlAgilityPack.HtmlNode htmlNode = html.DocumentNode;
//要取出的Xpath标签
HtmlAgilityPack.HtmlNode div = htmlNode.SelectSingleNode(".//*[@id='nv_forum']/div[6]/div[1]/a[1]");
HttpHelper http = new HttpHelper(); HttpItem item = new HttpItem() { URL = "http://www.sufeinet.com" };
HtmlAgilityPack.HtmlDocument html = new HtmlAgilityPack.HtmlDocument();
html.LoadHtml(http.GetHtml(item).Html);
HtmlAgilityPack.HtmlNode htmlNode = html.DocumentNode;
HtmlAgilityPack.HtmlNode div = htmlNode.SelectSingleNode(".//*[@id='nv_forum']/div[6]/div[1]/a[1]");
sandy1231 发表于 2014-1-8 19:36
刚接触这个类 全是英文看不懂,不过按飞哥的代码写 会报错 为啥 ?
[mw_shl_code=csharp,true] HttpHelper ...
private void button1_Click(object sender, EventArgs e)
{
HttpHelper http = new HttpHelper(); HttpItem item = new HttpItem() { URL = "http://www.sufeinet.com" };
HtmlAgilityPack.HtmlDocument html = new HtmlAgilityPack.HtmlDocument();
html.LoadHtml(http.GetHtml(item).Html);
HtmlAgilityPack.HtmlNode htmlNode = html.DocumentNode;
HtmlAgilityPack.HtmlNode div = htmlNode.SelectSingleNode(".//*[@id='nv_forum']/div[6]/div[1]/a[1]");
richTextBox1.Text = div.OuterHtml;
}
329337656 发表于 2020-4-25 12:14
HtmlDocument html = new HtmlDocument(); 为什么会提示0个参数的错误
329337656 发表于 2020-4-25 18:34
麻烦站在看看,为什么会这样的情况!
欢迎光临 苏飞论坛 (http://www.sufeinet.com/) | Powered by Discuz! X3.4 |