public static bool IsSelectorInUse(this HtmlDocument html, CssSelector selector)
        {
            bool isSelectorInUse =true;
            try
            {
                isSelectorInUse = html.DocumentNode.SelectNodes(selector.ToXPath()) != null;
            }
            catch (Exception)
            {

            }

            return isSelectorInUse;
        }
Ejemplo n.º 2
0
        private void FillSelectors(IEnumerable<string> selectors)
        {
            selectors.Distinct().ToList().ForEach(s =>
            {
                try
                {
                    var cssSelector = new CssSelector(s);
                    _selectors.Add(cssSelector);
                }
                catch (UnsupportedSelectorException ex)
                {

                }
            });
        }