$npx skillfedfor your agent

cssselect

cssselect parses CSS3 Selectors and translates them to XPath 1.0

Worth itPyPI HTMLReleased Jul 202624.0M downloads / moBSD-3-ClausePure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — cssselect-1.5.0-py3-none-any.whl
v1.5.0 · released 2026-07-27 · Python >=3.10

Yes. cssselect is a stable, actively maintained library with zero security vulnerabilities, low install friction, and permissive licensing. It solves a real problem—enabling CSS selector syntax in XPath-based document queries—and is already widely adopted (top 1000 PyPI packages). Install it if you need to translate CSS selectors to XPath for lxml or similar engines.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Requires Python 3.10 or later.
  • Low install friction; pure Python wheel with no runtime dependencies.
  • Actively maintained with a recent release 18 days ago and ongoing commits.

License · maintenance · safety

BSD-3-Clause (permissive) — BSD-3-Clause permissive license allows free use, modification, and distribution with minimal restrictions.

last release 2026-07-27 (18 days) · last repo commit 2026-08-09 · 309 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 24,049,380 downloads/mo, #927 on PyPI

Verify before relying

pip install cssselect

from cssselect import GenericTranslator

translator = GenericTranslator()
xpath = translator.css_to_xpath('div.content > p')
print(xpath)  # XPath expression for use with lxml or similar
  • Specific CSS3 selector features supported or unsupported beyond the W3C spec reference
  • Performance characteristics when translating large or complex selector expressions
  • Compatibility guarantees with specific XPath engine implementations beyond lxml
Same gist for agents: .md · .json

What it is and what it does

cssselect is a Python library that converts CSS3 selector syntax into XPath 1.0 expressions. It acts as a bridge between the familiar CSS selector syntax used in browsers and the XPath query language supported by XML/HTML parsing engines. The library takes a CSS selector string and produces an equivalent XPath expression that can be executed against a document tree using lxml or any other XPath-capable engine.

The package has no runtime dependencies and installs as a pure Python wheel, making it lightweight and easy to integrate. It's actively maintained, supports Python 3.10 through 3.14, and is widely used in web scraping and document parsing workflows where CSS selector syntax is more intuitive than raw XPath but XPath execution is required.

Use it for

  • Convert CSS selectors to XPath for querying HTML/XML with lxml when CSS selector support is unavailable
  • Build web scrapers that accept CSS selector syntax from users and execute them via XPath engines
  • Translate browser-style CSS selectors into XPath for server-side document parsing and testing
  • Integrate CSS selector parsing into tools that need to support both CSS and XPath query languages

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

Worth it

Yes.

cssselect is a stable, actively maintained library with zero security vulnerabilities, low install friction, and permissive licensing. It solves a real problem—enabling CSS selector syntax in XPath-based document queries—and is already widely adopted (top 1000 PyPI packages). Install it if you need to translate CSS selectors to XPath for lxml or similar engines.

Install

cssselect on PyPI

Before you install

Low install friction; pure Python wheel with no runtime dependencies. Actively maintained with a recent release 18 days ago and ongoing commits.

Requires Python 3.10 or later.

License in practice

BSD-3-Clause permissive license allows free use, modification, and distribution with minimal restrictions.

Quickstart

pip install cssselect

from cssselect import GenericTranslator

translator = GenericTranslator()
xpath = translator.css_to_xpath('div.content > p')
print(xpath)  # XPath expression for use with lxml or similar

Verify before relying

  • Specific CSS3 selector features supported or unsupported beyond the W3C spec reference
  • Performance characteristics when translating large or complex selector expressions
  • Compatibility guarantees with specific XPath engine implementations beyond lxml

Package facts

LicenseBSD-3-Clause permissive
Python supportSupports the current Python release >=3.10
Install frictionLow. Pure-Python wheel
Runtime dependenciesNone
MaintenanceActively maintained 18 days since the last release
Last repo commit
First released
Downloads24,049,380 / month, #927 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Development Status :: 4 - BetaIntended Audience :: DevelopersProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPy

Evidence: cssselect-1.5.0-py3-none-any.whl

Tags

Capabilities
css selector to xpathparse css3 selectorsxpath query builderhtml element selectioncss to xpath translationxml document queryinglxml css selector support
Topics
css-parsingxpath-generationweb-scraping

Let your AI agent find packages like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.

wish › “css selector to xpath”

  • cssselectcssselect parses CSS3 selectors and translates them to XPath 1.0…
  • parselParsel extracts data from HTML, JSON, and XML documents using CSS…
  • requests-htmlParses and scrapes HTML from web pages using a simple, intuitive API…

Give your agent the search over MCP, or paste the wish link into any chat.

More HTML packages

MarkupSafe Worth it
PyPI · Dynamic Content · released Sep 2025

MarkupSafe provides a text object that escapes special characters so untrusted strings can be safely embedded in HTML and XML without injection attacks.

BSD-3-Clausecompiled wheel · 3.9+aging
797.1Mdownloads / mo
Jinja2 Worth it
PyPI · Dynamic Content · released Mar 2025

Jinja2 is a templating engine that renders dynamic content by combining templates with Python-like syntax and data, supporting template inheritance, macros, autoescaping, and sandboxed execution.

BSD-3-Clausepure Python · 3.7+aging
718.6Mdownloads / mo
beautifulsoup4 Worth it
PyPI · Python Modules · released Jun 2026

Beautiful Soup parses HTML and XML documents into a navigable tree, providing Pythonic methods to search, iterate, and modify the parsed content.

Install it if you need to parse or extract data from markup documents.

MITpure Python · 3.7.0+
432.1Mdownloads / mo
lxml Worth it
PyPI · Python Modules · released May 2026

lxml provides Python bindings to libxml2 and libxslt, enabling parsing, validation, and transformation of XML and HTML documents through an ElementTree-compatible API with support for XPath, XSLT, and schema validation.

Install it if you need robust XML/HTML parsing, validation, or transformation; avoid it only if you must stay pure-Python and can accept slower performance.

permissive licensecompiled wheel · 3.8+
416.8Mdownloads / mo
docutils With conditions
PyPI · Software Development · released May 2026

Docutils converts plaintext documentation in reStructuredText format into multiple output formats including HTML, XML, and LaTeX using a modular processing system.

BSD-3-Clausepure Python · 3.9+
225.6Mdownloads / mo
Markdown Worth it
PyPI · Python Modules · released Jul 2026

Converts Markdown text to HTML using a Python implementation of John Gruber's Markdown specification, with support for extensions.

Install it if you need to parse Markdown in Python.

BSD-3-Clausepure Python · 3.10+
121.7Mdownloads / mo

See also elementpath · parsel · pyquery · selectolax · turbohtml · cssutils · cssselect2 · soupsieve · requests-html · itemloaders