symfony/dom-crawler
DomCrawler eases DOM navigation for HTML and XML documents, letting you query, filter, and extract content with CSS selectors and XPath. Part of the Symfony framework.
Adopt when:
DOMDocument code.symfony/* transitively; the marginal dependency cost is effectively zero.Look elsewhere when:
For executives (one paragraph): This is a free, MIT-licensed, widely-adopted PHP component that lets our engineers read and extract data from HTML and XML pages reliably. It turns several "someday" ideas — supplier feed ingestion, content migration, competitive price monitoring, and automated checks that our own checkout and signup forms still work — into things we can ship in a sprint instead of a quarter, with no vendor contract, no new infrastructure, and no per-seat cost. The realistic investment is not the library; it's one small, well-scoped pipeline with a named owner and monitoring, so it doesn't quietly rot. The main constraint to be aware of is a PHP 8.4 requirement for the newest major version, which we should sequence deliberately against our platform upgrade rather than absorb reactively.
For engineering (bullet summary):
App\Support\Html\DocumentParser) so domain and job code never imports Symfony\Component\DomCrawler\*. That boundary is what keeps exit cost low and lets us swap parsers if semantics shift.matches(), closest(), children() for combinators, charset detection from meta tags, textarea content, and FormField::getLabel() quoting. Pin versions and keep golden-file tests on representative fixtures.addXmlContent()) is patched across 5.4/6.4/7.4/8.x lines. Confirm our pinned version is on a patched release before parsing any untrusted XML.How can I help you explore Laravel packages today?