http://blog.csdn.net/xuwenwu/article/details/6009678

解决方案 »

  1.   

    http://www.cnblogs.com/yzpang/archive/2011/09/23/2186162.htmlhttp://www.cnblogs.com/wyux6868/archive/2009/11/11/1601140.html
      

  2.   

    抓取博客园首页推荐文章示例,可以参考一下:
    HttpWebRequest httpWebRequest = WebRequest.Create(@"http://www.cnblogs.com") as HttpWebRequest;
    HttpWebResponse httpWebResponse = httpWebRequest.GetResponse() as HttpWebResponse;
    Stream stream = httpWebResponse.GetResponseStream();
    StreamReader reader = new StreamReader(stream, Encoding.UTF8);
    string s = reader.ReadToEnd();
    reader.Close();
    stream.Close();
    httpWebResponse.Close();
    HtmlDocument htmlDoc = new HtmlDocument();
    htmlDoc.LoadHtml(s);
    HtmlNodeCollection anchors = htmlDoc.DocumentNode.SelectNodes(@"//a[@class='titlelnk']");
    foreach (HtmlNode anchor in anchors)
    Response.Write(anchor.InnerHtml + "<br/>");
    Response.End();