Skip to content

trenoncourt/HtmlAgilityPack.CssSelectors.NetCore

Repository files navigation

HtmlAgilityPack.CssSelectors.NetCore · NuGet PRs Welcome GitHub license

NetStandard version of HtmlAgilityPack.CssSelector which use HtmlAgilityPack

Installation

Install-Package HtmlAgilityPack.CssSelectors.NetCore

Usage

var doc = new HtmlAgilityPack.HtmlDocument();
doc.Load(new FileStream("test.html", FileMode.Open));

IList<HtmlNode> nodes = doc.QuerySelectorAll("div .my-class[data-attr=123] > ul li");
HtmlNode node = nodes[0].QuerySelector("p.with-this-class span[data-myattr]");

Buy me a beer

Donate