這里有個 非常好的分析 html的 類。
節(jié)約了不少時間。
項目地址
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://[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.
新聞熱點
疑難解答
圖片精選