public IList <IHtmlElement> SelectorAll(string html, string path, HtmlSelectorPathType pathType = HtmlSelectorPathType.XPath) { var dom = _htmlParser.Parse(html); if (pathType == HtmlSelectorPathType.Css) { var node = dom.QuerySelectorAll(path); return(Convent(node)); } else { throw new NotSupportedException($"不支持{pathType}的解析方式"); } }
public IList <IHtmlElement> SelectorAll(string html, string path, HtmlSelectorPathType pathType = HtmlSelectorPathType.XPath) { HtmlDocument htmlDocument = new HtmlDocument(); htmlDocument.LoadHtml(html); if (pathType == HtmlSelectorPathType.XPath) { var node = htmlDocument.DocumentNode.SelectNodes(path); return(Convent(node)); } else if (pathType == HtmlSelectorPathType.Css) { var node = htmlDocument.DocumentNode.QuerySelectorAll(path); return(Convent(node)); } else { throw new NotSupportedException(); } }
public IList <IHtmlElement> SelectorAll(string path, HtmlSelectorPathType pathType = HtmlSelectorPathType.XPath) { return(_htmlQuery.SelectorAll(_html, path, pathType)); }
public IHtmlElement Selector(string path, HtmlSelectorPathType pathType = HtmlSelectorPathType.XPath) { return(_htmlQuery.Selector(_html, path, pathType)); }
public abstract IList <IHtmlElement> SelectorAll(string path, HtmlSelectorPathType pathType = HtmlSelectorPathType.XPath);
public abstract IHtmlElement Selector(string path, HtmlSelectorPathType pathType = HtmlSelectorPathType.XPath);
public SelectorAttribute(string path, HtmlSelectorPathType pathType) : this(path) { this.PathType = pathType; }