blogjava's web log

          blogjava's web log
          ...

          dot net html分析類庫(kù)


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


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


          項(xiàng)目地址
          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 閱讀(359) 評(píng)論(0)  編輯  收藏 所屬分類: dot net相關(guān)

          導(dǎo)航

          常用鏈接

          留言簿(44)

          新聞檔案

          2.動(dòng)態(tài)語(yǔ)言

          3.工具箱

          9.文檔教程

          友情鏈接

          搜索

          最新評(píng)論

          主站蜘蛛池模板: 全南县| 大厂| 塘沽区| 秦皇岛市| 叙永县| 北流市| 宁夏| 利川市| 黎城县| 磐安县| 鱼台县| 哈密市| 察雅县| 商洛市| 桃园县| 财经| 敦煌市| 岚皋县| 安岳县| 鄄城县| 铁力市| 永德县| 贡觉县| 太和县| 黔东| 扶绥县| 涟水县| 毕节市| 喀喇沁旗| 荥经县| 承德市| 中牟县| 迭部县| 东辽县| 资兴市| 江口县| 葫芦岛市| 定陶县| 黄冈市| 东安县| 恩平市|