private static void FindChildren(IHtmlElement source, HtmlTag tag, HtmlElementSeletor result) { foreach (var item in source.Children()) { if (!(item is HtmlElement)) { continue; } var element = item as HtmlElement; if (element.Tag == tag) { result.AddElement(element); } FindChildren(element, tag, result); } }