PHPackages                             magento/cssxpath - 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. magento/cssxpath

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

magento/cssxpath
================

Convert CSS selectors to XPath queries.

v1.1.3(6y ago)11.0M↓17.9%21MITPHPPHP &gt;=7.1

Since Aug 7Pushed 6y agoCompare

[ Source](https://github.com/magento/CssXPath)[ Packagist](https://packagist.org/packages/magento/cssxpath)[ RSS](/packages/magento-cssxpath/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (14)Used By (1)

Translate CSS selectors to XPath queries.
=========================================

[](#translate-css-selectors-to-xpath-queries)

A lightweight and dependency free CSS to XPath translator. This repository is used to bring modern DOM functionality like [`querySelectorAll()`](https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelectorAll) to PHP in the [PHP.Gt/Dom](https://www.php.gt/dom) project.

---

[ ![Build status](https://camo.githubusercontent.com/1d987966d0e99364024a25a8e561791ae278fe53a659a842c503c379906bb19a/68747470733a2f2f62616467652e7374617475732e7068702e67742f63737378706174682d6275696c642e737667)](https://circleci.com/gh/PhpGt/CssXPath)[ ![Code quality](https://camo.githubusercontent.com/f78ee1879edff0701175a647602108a263c008f805691bf56beba613a925d492/68747470733a2f2f62616467652e7374617475732e7068702e67742f63737378706174682d7175616c6974792e737667)](https://scrutinizer-ci.com/g/PhpGt/CssXPath)[ ![Code coverage](https://camo.githubusercontent.com/0d4c45c2241954cda55ff14edd45128b8785b2550fea7c05c9518bfd68d639df/68747470733a2f2f62616467652e7374617475732e7068702e67742f63737378706174682d636f7665726167652e737667)](https://scrutinizer-ci.com/g/PhpGt/CssXPath)[ ![Current version](https://camo.githubusercontent.com/b9a5291e90cd36e5a5925c6a822ea8147e90ea1dfc0536c3ea4dc6b13de5d07c/68747470733a2f2f62616467652e7374617475732e7068702e67742f63737378706174682d76657273696f6e2e737667)](https://packagist.org/packages/PhpGt/CssXPath)[ ![PHP.Gt/CssXPath documentation](https://camo.githubusercontent.com/739f4457ebadb35be5763fa3842e4a1491fbaab5cd84ed1c4f316b119e6cdc4d/68747470733a2f2f62616467652e7374617475732e7068702e67742f63737378706174682d646f63732e737667)](http://www.php.gt/dom)Example usage
-------------

[](#example-usage)

```
use Gt\CssXPath\Translator;

$html =
