惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - 叶小钗
MyScale Blog
MyScale Blog
博客园 - 【当耐特】
I
InfoQ
腾讯CDC
aimingoo的专栏
aimingoo的专栏
L
LangChain Blog
人人都是产品经理
人人都是产品经理
D
DataBreaches.Net
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Engineering at Meta
Engineering at Meta
A
About on SuperTechFans
Google DeepMind News
Google DeepMind News
Vercel News
Vercel News
C
Check Point Blog
B
Blog RSS Feed
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
美团技术团队
Stack Overflow Blog
Stack Overflow Blog
Y
Y Combinator Blog
D
Docker
MongoDB | Blog
MongoDB | Blog
量子位
博客园_首页

博客园 - hello csharp

[导入]Nhibernate引入自定义Membership和Role 推荐个不错的屏幕捕获程序 测试Google Docs 发布的文章.。。 Guidelines – a hidden feature for the Visual Studio Editor Gridview, ObjectDataSource Making life easy Applied MS Reporting Services 101 using Smart Client Database Provider-based ASP.NET Membership Provider HTMLEditor Provider - How to write a custom provider for ASP.NET 2.0 Firebug-javascript/css/ajax/dom调试器【这款不错】 Automatic Sql Server Backup Utility Using sqlserveragent LiveWriter测试 发布个小软件给大伙玩玩 [js小技巧]鼠标移到图片高亮度显示 系统发邮件测试 Dumbster 【小技巧】如何得到一个网页的所有a标记 herf 链接代码 读新浪博客示例[源代码下载] Intellisense for the NHibernate XML Schemas Develop Reports Using Crystal Reports in .NET 2005 [小技巧]winfrom使用多线程
dot net html分析类库
hello csharp · 2006-10-31 · via 博客园 - hello csharp

上次我写的
 【小技巧】如何得到一个网页的所有a标记 herf 链接代码
这样很是麻烦。

这里有个 非常好的分析 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.