blogjava's web log

          blogjava's web log
          ...

          dot net html分析類庫


          上次我寫的
          ?【小技巧】如何得到一個網(wǎng)頁的所有a標記 herf 鏈接代碼
          這樣很是麻煩。


          這里有個 非常好的分析 html的 類。
          節(jié)約了不少時間。


          項目地址
          http://www.codeplex.com/Wiki/View.aspx?ProjectName=htmlagilitypack


          For example, here is how you would fix all hrefs in an HTML file:

          HtmlDocument doc = new HtmlDocument();
          doc.Load("file.htm");
          foreach(HtmlNode link in doc.DocumentElement.SelectNodes("http://a)
          {
          HtmlAttribute att = link
          ;
          att.Value = FixLink(att);
          }
          doc.Save("file.htm");

          If you want to participate to the project - because that's the whole purpose of putting the source there, right - use the forums or drop me a note (simon underscore mourier at hotmail dot com)!

          Happy coding, scraping, scanning, html-ing, xhtml-ing, etc... :^)
          Simon Mourier.

          posted on 2006-10-31 15:44 record java and net 閱讀(355) 評論(0)  編輯  收藏 所屬分類: dot net相關(guān)

          導航

          常用鏈接

          留言簿(44)

          新聞檔案

          2.動態(tài)語言

          3.工具箱

          9.文檔教程

          友情鏈接

          搜索

          最新評論

          主站蜘蛛池模板: 石家庄市| 许昌市| 灵山县| 和静县| 邹平县| 洞口县| 鲁甸县| 凤冈县| 绥中县| 类乌齐县| 张家口市| 玉林市| 金华市| 运城市| 涞源县| 得荣县| 靖西县| 溧水县| 洪泽县| 翁牛特旗| 托克逊县| 万年县| 海兴县| 北安市| 尼玛县| 建昌县| 马山县| 屏东市| 汪清县| 遂宁市| 黔江区| 灵台县| 乌兰浩特市| 日喀则市| 洛南县| 沾益县| 鄄城县| 新密市| 卓资县| 屏东市| 赤水市|