using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; using HtmlAgilityPack; namespace Scraping.Selectors { internal static class HtmlAgilityPackExt { public static ReadOnlyCollection ToReadOnlyCollection(this IEnumerable nodeCollection) => (nodeCollection ?? new List()) .Select(n => new WebElement(n) as WebElement) .ToList() .AsReadOnly(); } }