找回密码
 注册
搜索
热搜: 回贴

ASP.NET技巧:dot net html分析类库

2009-12-13 12:38| 发布者: admin| 查看: 65| 评论: 0|原作者: 江海

●这里有个非常好的分析html的类。 节约......


这里有个 非常好的分析 html的 类。
节约了不少时间。

项目地址
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("//a@href")
{
HtmlAttribute att = link"href";
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.

最新评论

QQ|小黑屋|最新主题|手机版|微赢网络技术论坛 ( 苏ICP备08020429号 )

GMT+8, 2024-9-29 19:15 , Processed in 0.338409 second(s), 12 queries , Gzip On, MemCache On.

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

返回顶部