Module selector

Module selector 

Source
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§

CachedSelectors
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