PHPackages                             devcapere/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. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. devcapere/pquery

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

devcapere/pquery
================

A jQuery like html dom parser written in php. This fork add fixes for php &gt;= 8.0

0110PHP

Since Jun 4Pushed 1y agoCompare

[ Source](https://github.com/DevCapere/pquery)[ Packagist](https://packagist.org/packages/devcapere/pquery)[ RSS](/packages/devcapere-pquery/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

pQuery
======

[](#pquery)

[![Build Status](https://camo.githubusercontent.com/6c6829f442cd235dd0e8d82b42db10dae774933eacc5e757bcf304c359cb4791/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f7462757272792f7071756572792e7376673f7374796c653d666c6174)](https://travis-ci.org/tburry/pquery)[![Coverage](https://camo.githubusercontent.com/57c5205b74026f3cbdc48fce5c9937fee2d7762ffc35ad9495f98c75c65fddee/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f7462757272792f7071756572792e7376673f7374796c653d666c6174)](https://scrutinizer-ci.com/g/tburry/pquery/)[![Latest Stable Version](https://camo.githubusercontent.com/5dc1a0ddb8c48dbc1cc20c98c18f9f5fdd34e2bac42654b064e38d7de586a3ac/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7462757272792f7071756572792e7376673f7374796c653d666c6174)](https://packagist.org/packages/tburry/pquery)

pQuery is a jQuery like html dom parser written in php. It is a fork of the [ganon dom parser](https://code.google.com/p/ganon/).

Basic usage
-----------

[](#basic-usage)

To get started using pQuery do the following.

1. Require the pQuery library into your project using [composer](http://getcomposer.org/doc/01-basic-usage.md#the-require-key).
2. Parse a snippet of html using `pQuery::parseStr()` or `pQuery::parseFile()` to return a document object model (DOM).
3. Run jQuery like functions on the DOM.

Example
-------

[](#example)

The following example parses an html string and does some manipulation on it.

```
$html = '
  Hello
  Cruel
  World
';

$dom = pQuery::parseStr($html);

$dom->query('.inner')
    ->tagName('span');

$dom->query('.adj')
    ->html('Beautiful')
    ->tagName('i');

echo $dom->html();
```

Differences between pQuery and ganon
------------------------------------

[](#differences-between-pquery-and-ganon)

pQuery is a fork of the [ganon php processor](https://code.google.com/p/ganon/). Most of the functionality is identical to ganon with the following exceptions.

- pQuery is a composer package.
- pQuery renames ganon's classes and puts them into a namespace.
- pQuery is used only with objects rather than functions so that it can be autoloaded.
- pQuery Adds the `IQuery` interface and the `pQuery` object that define the jQuery-like interface for querying the dom.
- pQuery implements more of jQuery's methods. See the `IQuery` interface for a list of methods.
- pQuery supports adding tags to the dom using the `` notation rather than just `div`.

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance35

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity15

Early-stage or recently created project

 Bus Factor1

Top contributor holds 95.2% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/30b54fce2c4786a0c474410ae0ecad48f8b094446ed9db729aafd3c4efd91ae1?d=identicon)[devcapere](/maintainers/devcapere)

---

Top Contributors

[![tburry](https://avatars.githubusercontent.com/u/97432?v=4)](https://github.com/tburry "tburry (60 commits)")[![ayumaru](https://avatars.githubusercontent.com/u/59921992?v=4)](https://github.com/ayumaru "ayumaru (3 commits)")

### Embed Badge

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

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

###  Alternatives

[mck89/peast

Peast is PHP library that generates AST for JavaScript code

19139.2M47](/packages/mck89-peast)[sauladam/shipment-tracker

Parses tracking information for several carriers, like UPS, USPS, DHL and GLS by simply scraping the data. No need for any kind of API access.

9843.5k](/packages/sauladam-shipment-tracker)[jstewmc/rtf

Read and write Rich Text Format (RTF) documents with PHP

45153.1k6](/packages/jstewmc-rtf)[tcds-io/php-jackson

A lightweight, flexible object serializer for PHP, inspired by FasterXML/jackson

113.2k10](/packages/tcds-io-php-jackson)

PHPackages © 2026

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