PHPackages                             gravitypdf/querypath - 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. gravitypdf/querypath

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

gravitypdf/querypath
====================

PHP library for HTML(5)/XML querying (CSS 4 or XPath) and processing (like jQuery) with PHP 7.1 to 8.5 support

4.2.0(2mo ago)281.2M↑15.1%4[3 issues](https://github.com/GravityPDF/querypath/issues)[2 PRs](https://github.com/GravityPDF/querypath/pulls)1MITPHPPHP ^7.1 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0CI passing

Since Feb 3Pushed 2mo ago3 watchersCompare

[ Source](https://github.com/GravityPDF/querypath)[ Packagist](https://packagist.org/packages/gravitypdf/querypath)[ Docs](https://github.com/gravitypdf/querypath)[ Fund](https://www.paypal.com/donate/?hosted_button_id=VRUVBVM6BZPKN)[ RSS](/packages/gravitypdf-querypath/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (7)Dependencies (10)Versions (27)Used By (1)

QueryPath: Find the better way
==============================

[](#querypath-find-the-better-way)

QueryPath is a jQuery-like library for working with XML and HTML(5) documents in PHP. It is stable software, [with the original library garnering 4M+ downloads](https://packagist.org/packages/querypath/querypath) since first published in 2009.

**This is a fork of a fork. The [original library](https://github.com/technosophos/querypath), and [subsequent fork](https://github.com/arthurkushman/querypath), are no longer being maintained. The aim of `gravitypdf/querypath` is to ensure the library remains compatible with the latest version of PHP, and bug free. 🧑‍💻There is still a lot of legacy code to clean up + modernize, and any assistance given is appreciated.**

> If you are viewing this file on QueryPath GitHub repository homepage or on Packagist, please note that the default repository branch is `main` which can differ from the last stable release.

[![Latest Stable Version](https://camo.githubusercontent.com/1a11ab1802b3525fc23c6b0c4871bbbade6bbbf4e99de78275beb8a68da540f5/687474703a2f2f706f7365722e707567782e6f72672f677261766974797064662f7175657279706174682f76)](https://packagist.org/packages/gravitypdf/querypath) [![License](https://camo.githubusercontent.com/78f8f73c158fef418415f71b1cf98cd802e12950309c30360fb9b2e13e360cb0/687474703a2f2f706f7365722e707567782e6f72672f677261766974797064662f7175657279706174682f6c6963656e7365)](https://packagist.org/packages/gravitypdf/querypath) [![codecov](https://camo.githubusercontent.com/76218e0f30d868bccd2d4ef65bdaa8adf4d8aff7cceab31c1c359c3b6412767b/68747470733a2f2f636f6465636f762e696f2f67682f477261766974795044462f7175657279706174682f6272616e63682f6d61696e2f67726170682f62616467652e7376673f746f6b656e3d4473756c376633364b34)](https://codecov.io/gh/GravityPDF/querypath) [![PHP Version Require](https://camo.githubusercontent.com/5102b6787b94ecb016226902ca24dda5591417906792448965e5ae980feadbde/687474703a2f2f706f7365722e707567782e6f72672f677261766974797064662f7175657279706174682f726571756972652f706870)](https://packagist.org/packages/gravitypdf/querypath)

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

[](#installation)

```
composer require gravitypdf/querypath

```

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

[](#basic-usage)

To parse HTML or XML:

```
