private static List<string> ExtractCodeComments(HtmlNode articleNode) { var nginx = articleNode.GetElementsByClassName("nginx"); return nginx?.Select(n => n.InnerText).ToList() ?? new List<string>(); }
private static void DeleteCodeNodes(HtmlNode articleNode) { var codeNotes = articleNode.GetElementsByClassName("nginx"); foreach (var node in codeNotes) { node.Remove(); } codeNotes = articleNode.GetElementsByClassName("bash"); foreach (var node in codeNotes) { node.Remove(); } }