Asp. NET tip: dot net HTML Analysis class library

Source: Internet
Author: User
Tags dot net
Asp.net| Tips

Here's a very good class for parsing HTML.
Save a lot of time.


Project Address
Http://www.codeplex.com/Wiki/View.aspx?ProjectName=htmlagilitypack


For example, this is how to would fix all hrefs in a 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 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.



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.