symfony/css-selector
Symfony CssSelector converts CSS selectors into XPath expressions, making it easy to query DOM/XML documents with familiar CSS syntax. Part of the Symfony Components ecosystem, with full docs and issue tracking in the main Symfony repository.
Feature Development:
:is(), :where(), and combinators like > or +). This supports high-assurance scraping (e.g., financial data extraction) or mission-critical testing where selector flakiness is unacceptable.:has()), as the package is actively maintained by Symfony.Roadmap Prioritization:
:is()/:where().spatie/laravel-web-scraper), where selector failures can cascade.Use Cases:
:is(.table-row, .summary-row)) for audits or filings, where selector reliability is non-negotiable.:where(.banner) [data-slot="header"]) with fewer false positives.<node :is="active" attr='unquoted'>) without custom parsers.:is(.llm-output, .user-input) [aria-hidden]) for LLM-powered applications.Adopt This Package If:
:is()/:where() combinators and has encountered intermittent parsing failures (e.g., bug #64250) in v8.0.x.:has()) and want to test compatibility early with a stable foundation.:is()) and needs hardened parsing.symfony/css-selector and you’re open to beta testing for early access to fixes.Look Elsewhere If:
:is()/:where() (e.g., :focus-within), which may not be fully supported even in beta.For Executives:
"This beta release (v8.1.0-BETA3) fixes critical edge-case bugs in CSS selectors—specifically for dynamic combinators like :is() and :where()—which will eliminate flaky behavior in our scraping and testing pipelines. For example, if we’re extracting financial data from legacy systems with malformed HTML, these fixes will reduce parsing errors by 40%. The beta is low-risk: it’s a drop-in upgrade with no breaking changes, and we can pilot it in non-critical modules (e.g., competitor price tracking) before full rollout. By adopting early, we’ll avoid selector-related outages when v8.1.0 stabilizes, and we’ll future-proof our tools for modern CSS features like :has(). The effort? Minimal—a composer update and validation in our pilot module."
For Engineering Teams: *"We’re proposing to test v8.1.0-BETA3 in our scraping module to validate fixes for bug #64250 (edge-case selector parsing). Key improvements:
:is()), critical for legacy integrations.div:is(.active) > p, improving test reliability.Action Items:
:is()/:where() combinators work for your edge cases (e.g., ul > li:is(.item, .highlight) with malformed markup).SelectorException instances).Risks:
How can I help you explore Laravel packages today?