首页 > 编程 > .NET > 正文

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

2024-07-10 13:09:21
字体:
来源:转载
供稿:网友

这里有个 非常好的分析 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("//[email protected]")
{
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.

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表