Remove whitespaces and newlines when parsing with HtmlAgilityPack
问题 I tried to parse HTML with the HtmlAgilityPack in the following way: HtmlDocument htmlDoc = new HtmlDocument(); htmlDoc.LoadHtml(xhtmlString); Unfortunately the xhtmlString contains unnecessary whitespaces and newline characters, so the _text of htmlDoc now looks like this: <html xmlns=\"http://www.w3.org/1999/xhtml\">\n\t<head></head>\n\t<body>\n\n<p>Alle Auktionen<br /></p>\n\n\t</body>\n</html> This is a problem for me when working with the child elements of the body. What is the easiest