Overview of Soup Sieve CSS Selectors
mainSoup Sieve is a CSS selector library for Beautiful Soup 4 that enables selecting, matching, and filtering using modern CSS selectors (from CSS level 1 through the latest CSS level 4 drafts).
It can be used automatically by Beautiful Soup's .select() method (as of version 4.7.0) or imported directly for specialized parsing.
Supported selector types include:
- Classes:
.classes - IDs:
#ids - Attributes:
[attributes=value] - Combinators:
parent child,parent > child,sibling ~ sibling,sibling + sibling - Pseudo-classes:
:not(),:is(),:has()
Note: Selectors that do not have meaningful functionality in a non-browser environment will simply not match anything.