PHPackages                             iamcal/pquery - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. iamcal/pquery

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

iamcal/pquery
=============

A jQuery-style DOM traversal tool, for PHP

v1.0.0(5y ago)1201MITPHPPHP &gt;=5.2.0CI failing

Since Jan 23Pushed 5y ago1 watchersCompare

[ Source](https://github.com/iamcal/pquery)[ Packagist](https://packagist.org/packages/iamcal/pquery)[ RSS](/packages/iamcal-pquery/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (1)Versions (3)Used By (0)

pQuery - jQuery style DOM traversal, in PHP
===========================================

[](#pquery---jquery-style-dom-traversal-in-php)

[![Build Status](https://github.com/iamcal/pquery/actions/workflows/php.yml/badge.svg)](https://github.com/iamcal/pquery/actions)[![Coverage Status](https://camo.githubusercontent.com/4fa67256efa8bebc32e17fb92b27860702f9d0b43ea7fe39eb42bfdbf8fcff67/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f69616d63616c2f7071756572792f62616467652e7376673f6272616e63683d6d61696e)](https://coveralls.io/github/iamcal/pquery?branch=main)[![Latest Stable Version](https://camo.githubusercontent.com/7b4d1ab29f45dfce8e49d849ecce34add3b023cf74a13db3bb60ec50789504ed/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f69616d63616c2f7071756572792e7376673f7374796c653d666c6174)](https://packagist.org/packages/iamcal/pquery)

**Beware!** There are several projects with the name pQuery. You might be looking for a different one.

This PHP library allows you to use jQuery-style selectors to find DOM nodes in HTML documents. It uses the PHP DOM classes under the covers, which ultimately use libxml for document parsing.

Installation
------------

[](#installation)

You can install using composer:

```
composer require iamcal/pquery

```

This will put the pQuery class into the autoloader in `vendor/autoload.php`.

Alertnatively you can clone this repo and include `src/pQuery.php` directly.

Basic Usage
-----------

[](#basic-usage)

```
$html = 'Hello World';

$pq = pQuery::fromHTML($html);

$nodes = $pq->find('b');
// $nodes is an array of DOMNode objects

```

Supported selectors:

```
tag
tag.class
tag#id
.class
#id

```

Selectors can be chained together, e.g. `table#my-table th a.info`

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

1940d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a85bb39bd5cc12c0027f8242c6e42f95fc17c6a56761786410f3450c9855d0d5?d=identicon)[iamcal](/maintainers/iamcal)

---

Top Contributors

[![iamcal](https://avatars.githubusercontent.com/u/173750?v=4)](https://github.com/iamcal "iamcal (39 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/iamcal-pquery/health.svg)

```
[![Health](https://phpackages.com/badges/iamcal-pquery/health.svg)](https://phpackages.com/packages/iamcal-pquery)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
