tburry/pquery
pQuery is a jQuery-inspired PHP library for parsing and manipulating HTML. It offers CSS selector queries, chainable DOM traversal and modification, and a familiar API for scraping or transforming markup without fragile regex.
$html->find('.card')->eq(0)->attr('href')) on top of PHP's native DOMDocument. The decision it informs is whether to spend engineering days writing CSS-selector-to-XPath glue and traversal helpers, or adopt a ready-made facade. The genuine value is ergonomics, not capability — everything it does is achievable with DOMDocument + DOMXPath + Symfony's CssSelector.Consider it when:
DOMDocument behavior changes).DOMDocument's parser is not an HTML5-spec parser, so malformed or heavily-minified markup can produce surprising trees.src/ and own it," not "add to composer.json and forget."Look elsewhere when:
symfony/dom-crawler + symfony/css-selector is MIT-licensed, actively maintained, and covers the same selector vocabulary. This is the default answer for most teams.masterminds/html5 or a wrapper like DiDOM built on it.To executives: This is a small, low-cost convenience library that lets our PHP engineers write page-parsing code in a syntax most web developers already know. It is best framed as a prototyping accelerant, not a platform commitment. Two risks belong on the record: it is effectively unmaintained (no release since 2016, one author) and it carries an LGPL-2.1 license that needs legal sign-off before it ships inside distributed software. Recommendation: approve for internal tools and experiments, and default new production parsing work to Symfony's actively maintained equivalents so we do not inherit a migration project.
To engineering: pQuery gives you jQuery selectors and chaining over native DOMDocument — fast to read, fast to write, and a real fit for scraper and HTML-rewriting tasks. Understand the trade: it is a 2016-era dependency on modern PHP, it is not an HTML5 parser, and it will not get fixes. Treat it as a vendored internal utility rather than a Composer dependency you upgrade; if the code is customer-facing, in a security-sensitive path, or likely to outlive one quarter, use symfony/dom-crawler with css-selector instead and keep the same mental model.
How can I help you explore Laravel packages today?