Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/atifaziz/fizzler
.NET CSS Selector Engine
https://github.com/atifaziz/fizzler
css
Last synced: 15 days ago
JSON representation
.NET CSS Selector Engine
- Host: GitHub
- URL: https://github.com/atifaziz/fizzler
- Owner: atifaziz
- License: other
- Created: 2015-08-23T12:30:18.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2024-07-14T17:46:42.000Z (4 months ago)
- Last Synced: 2024-10-12T17:59:57.503Z (about 1 month ago)
- Topics: css
- Language: C#
- Size: 713 KB
- Stars: 133
- Watchers: 10
- Forks: 29
- Open Issues: 14
-
Metadata Files:
- Readme: README.md
- License: COPYING.txt
Awesome Lists containing this project
README
# Fizzler: .NET CSS Selector Engine
[![Build Status][build-badge]][builds]
[![NuGet][nuget-badge]][nuget-pkg]
[![MyGet][myget-badge]][edge-pkgs]Fizzler is a .NET Standard 1.0 library; it is a [W3C Selectors
(Level 3)][w3cs3] parser and generic selector framework over document
hierarchies.The [default implementation][fizzhap] is based on [HTMLAgilityPack][hap] and
selects from HTML documents. The unit tests are based on the jQuery
selector engine tests.Contributions are welcome in forms of:
* Increased selector support
* Implementation over an HTML-like hierarchical document model
* Re-factorings
* Improved tests## Examples
The following example uses [Fizzler.Systems.HtmlAgilityPack][fizzhap]:
```c#
// Load the document using HTMLAgilityPack as normal
var html = new HtmlDocument();
html.LoadHtml(@"
Fizzler
CSS Selector Engine
");// Fizzler for HtmlAgilityPack is implemented as the
// QuerySelectorAll extension method on HtmlNodevar document = html.DocumentNode;
// yields: [
Fizzler
]
document.QuerySelectorAll(".content");// yields: [
Fizzler
,CSS Selector Engine
]
document.QuerySelectorAll("p");// yields empty sequence
document.QuerySelectorAll("body>p");// yields [
Fizzler
,CSS Selector Engine
]
document.QuerySelectorAll("body p");// yields [
Fizzler
]
document.QuerySelectorAll("p:first-child");
```[build-badge]: https://img.shields.io/appveyor/ci/raboof/fizzler/master.svg?label=windows
[builds]: https://ci.appveyor.com/project/raboof/fizzler
[myget-badge]: https://img.shields.io/myget/raboof/vpre/Fizzler.svg?label=myget
[edge-pkgs]: https://www.myget.org/feed/raboof/package/nuget/Fizzler
[nuget-badge]: https://img.shields.io/nuget/v/Fizzler.svg
[nuget-pkg]: https://www.nuget.org/packages/Fizzler[w3cs3]: https://www.w3.org/TR/selectors-3/
[fizzhap]: http://www.nuget.org/packages/Fizzler.Systems.HtmlAgilityPack/
[hap]: http://html-agility-pack.net/