Expand description
CSS Selector utilities for halldyll-parser
This module provides:
- Pre-compiled, cached CSS selectors
- Safe selector parsing with error handling
- Common selector patterns for web scraping
Structs§
- Cached
Selectors - Pre-compiled selectors for common elements
- SELECTORS
Constants§
- BLOCK_
ELEMENTS - Selectors for block elements that should add line breaks
- BOILERPLATE_
SELECTORS - Selectors for elements to remove (boilerplate)
- CONTENT_
SELECTORS - Common content area selectors
- INLINE_
ELEMENTS - Selectors for inline elements that should preserve text
Functions§
- attr_
contains_ selector - Build an attribute contains selector
- attr_
selector - Build an attribute selector
- attr_
starts_ with_ selector - Build an attribute starts-with selector
- child_
selector - Build a child selector
- class_
selector - Build a class selector
- descendant_
selector - Build a descendant selector
- get_
or_ create_ selector - Get or create a selector from the cache
- heading_
selector - Build a selector for heading level
- id_
selector - Build an ID selector
- link_
rel_ selector - Create selector for link by rel
- meta_
name_ selector - Create selector for meta tag by name
- meta_
property_ selector - Create selector for meta tag by property (OG/Twitter)
- multi_
selector - Build a multiple selector (OR)
- parse_
selector - Parse a CSS selector with proper error handling
- try_
parse_ selector - Try to parse a selector, returning None on failure