65.9K
CodeProject is changing. Read more.
Home

Remove all the HTML tags and display a plain text only inside (in case XML is not well formed)

starIconstarIconstarIconstarIconstarIcon

5.00/5 (4 votes)

Dec 21, 2010

CPOL
viewsIcon

14071

Consider using the open source HTML Agility Pack library (htmlagilitypack.codeplex.com).It lets you use XPATH queries to access very specific parts of an HMTL document, and the HTML does not have to be valid, well-formed XML. In addition to accessing the raw inner text of an element you can...

Consider using the open source HTML Agility Pack library (htmlagilitypack.codeplex.com). It lets you use XPATH queries to access very specific parts of an HMTL document, and the HTML does not have to be valid, well-formed XML. In addition to accessing the raw inner text of an element you can select specific attribute values, which is useful for getting things like meta description content or image alt/title text.