这里有个 非常好的分析 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.
新闻热点
疑难解答
图片精选