private static void CollectChildrenNodesInnerHtml(HtmlNodeCollection nodesCollection, StringBuilder contentText) { foreach (var childNode in nodesCollection) { if (CanIncludeNodeToResults(childNode)) { if (childNode.ChildNodes != null && childNode.ChildNodes.Count > 0) { CollectChildrenNodesInnerHtml(childNode.ChildNodes, contentText); } else { if (!string.IsNullOrEmpty(childNode.InnerText)) { contentText.Append(childNode.InnerText); } } } } }