div、span、labelsなど、基本的に特定の属性を持つ要素を選択しようとしています。
IEnumerable<HtmlNode> allDivsWithItemType = _doc.DocumentNode.Descendants("div").Where(d => d.Attributes.Contains("itemtype"));
すべての子孫を上記のように1つにロープでつなぐ方法はありますか?上記は明らかにdivのみを見つけるので。1つの単語を置き換えるために、余分な行全体を追加する重複コードを回避しようとしています。
例(動作しません)
IEnumerable<HtmlNode> allDivsWithItemType = _doc.DocumentNode.Descendants("*").Where(d => d.Attributes.Contains("itemtype"));