HtmlAgilityPack CSS Selector
C# HTML
Switch branches/tags
Nothing to show
Clone or download
hcesar Merge pull request #6 from bitbranch/master
Fix for LoadPseudoClasses failing in certain conditions
Latest commit 70f9364 May 5, 2017

README.md

HtmlAgilityPack CSS Selector

HAP-CSS is a .NET Extension Method for HtmlAgilityPack HtmlDocument and HtmlNode classes. It is a handy tool for Web scrapers, and a good alternative to HAP XPath queries.

Usage:

var doc = new HtmlAgilityPack.HtmlDocument();
doc.Load("test.html");

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