$npx skillfedfor your agent

cssselect2

CSS selectors for Python ElementTree

With conditionsPyPI WWW/HTTPReleased Feb 202652.7M downloads / mopermissive licensePure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — cssselect2-0.9.0-py3-none-any.whl
v0.9.0 · released 2026-02-12 · Python >=3.10 · 2 runtime deps: tinycss2, webencodings

Yes, if you need CSS selector matching against ElementTree-parsed markup. The package is stable, has no known vulnerabilities, low install friction, and permissive licensing. The aging maintenance status (183 days since last release) is a minor concern for a mature library, but the recent repository activity and production-stable classifier suggest it is not abandoned. Install it when CSS selector support is a core requirement for your document processing.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 only two lightweight runtime dependencies (tinycss2 and webencodings).
  • Maintenance is aging: last release was 183 days ago, though the repository remains active with a recent commit on 2026-02-12.

License · maintenance · safety

permissive license (permissive) — BSD permissive license means you can use, modify, and distribute this package with minimal restrictions, suitable for both open-source and proprietary projects.

last release 2026-02-12 (183 days) · last repo commit 2026-02-12 · 35 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 52,710,104 downloads/mo, #558 on PyPI

Verify before relying

pip install cssselect2

from cssselect2 import compile_selector_list

selectors = compile_selector_list('div.content > p')
for selector in selectors:
    print(selector)
  • Whether cssselect2 handles CSS4 selector features comprehensively or has known limitations compared to browser implementations.
  • Performance characteristics when matching large numbers of selectors or complex documents.
  • How well it integrates with specific ElementTree implementations beyond the documented examples.
Same gist for agents: .md · .json

What it is and what it does

cssselect2 is a CSS4 selector parser and matcher for Python that works with ElementTree-like parsers (including lxml, html5lib, and the standard library's ElementTree). It translates CSS selector strings into objects that can be matched against markup documents to find and select elements. The package is production-stable, supports Python 3.10 through 3.14 on both CPython and PyPy, and has minimal dependencies—only tinycss2 for CSS tokenization and webencodings for character encoding handling.

The library is maintained by CourtBouillon and is part of a broader ecosystem for web document processing in Python. It's particularly useful when you need to apply CSS-based element selection logic to parsed markup without a full DOM implementation, and when you want to work with ElementTree's lightweight parsing model rather than heavier alternatives.

Use it for

  • Extract specific elements from HTML or XML documents using CSS selectors in web scraping scripts.
  • Build CSS-based filtering logic into document processing pipelines that use ElementTree parsers.
  • Implement stylesheet-like element selection in tools that generate or transform markup.
  • Match elements in markup documents when integrating with lxml or html5lib parsers.
  • Create CSS selector-based rules for document analysis or validation workflows.

Worth the install?

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

With conditions

Yes, if you need CSS selector matching against ElementTree-parsed markup.

The package is stable, has no known vulnerabilities, low install friction, and permissive licensing. The aging maintenance status (183 days since last release) is a minor concern for a mature library, but the recent repository activity and production-stable classifier suggest it is not abandoned. Install it when CSS selector support is a core requirement for your document processing.

Install

cssselect2 on PyPI

Before you install

Low install friction—pure Python wheel with only two lightweight runtime dependencies (tinycss2 and webencodings). Maintenance is aging: last release was 183 days ago, though the repository remains active with a recent commit on 2026-02-12.

Requires Python 3.10 or later.

License in practice

BSD permissive license means you can use, modify, and distribute this package with minimal restrictions, suitable for both open-source and proprietary projects.

Quickstart

pip install cssselect2

from cssselect2 import compile_selector_list

selectors = compile_selector_list('div.content > p')
for selector in selectors:
    print(selector)

Verify before relying

  • Whether cssselect2 handles CSS4 selector features comprehensively or has known limitations compared to browser implementations.
  • Performance characteristics when matching large numbers of selectors or complex documents.
  • How well it integrates with specific ElementTree implementations beyond the documented examples.

Package facts

Licensepermissive license permissive
Python supportSupports the current Python release >=3.10
Install frictionLow. Pure-Python wheel
Runtime dependencies
2 packages
tinycss2webencodings
MaintenanceAging 183 days since the last release
Last repo commit
First released
Downloads52,710,104 / month, #558 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming 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 :: PyPyTopic :: Internet :: WWW/HTTP

Evidence: cssselect2-0.9.0-py3-none-any.whl

Tags

Capabilities
css selector parsingelementtree css matchinghtml xml element selectioncss4 selectors pythonmarkup document queryingcss selector implementationelement tree css queries
Topics
css-selectorsmarkup-parsingelementtree
PyPI keywords
csselementtree

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 › “elementtree css matching”

  • cssselect2cssselect2 parses and matches CSS4 selectors against markup documents…
  • soupsieveSoupsieve is a CSS selector library designed to work with Beautiful…
  • elementpathProvides XPath 1.0, 2.0, 3.0, and 3.1 selectors for querying…

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

More WWW/HTTP packages

urllib3 Worth it
PyPI · Libraries · released May 2026

urllib3 is an HTTP client library that provides thread-safe connection pooling, SSL/TLS verification, multipart file uploads, request retries, compression support, and proxy handling for Python applications.

MITpure Python · 3.10+
1.8Bdownloads / mo
requests Worth it
PyPI · Libraries · released May 2026

Requests is a Python HTTP library that simplifies sending HTTP/1.1 requests with automatic handling of headers, authentication, cookies, and response parsing.

Apache-2.0pure Python · 3.10+
1.8Bdownloads / mo
h11 With conditions
PyPI · WWW/HTTP · released Apr 2025

h11 is a pure-Python HTTP/1.1 protocol implementation that handles parsing and serializing HTTP messages without any built-in I/O, letting you integrate it with any network layer you choose.

MITpure Python · 3.8+aging
894.9Mdownloads / mo
httpx Worth it
PyPI · WWW/HTTP · released Dec 2024

HTTPX is a fully featured HTTP client library for Python that provides both sync and async APIs, with support for HTTP/1.1 and HTTP/2, plus an integrated command-line client.

Install it if you are building new projects or modernizing existing ones that rely on HTTP.

BSD-3-Clausepure Python · 3.8+
797.0Mdownloads / mo
httpcore With conditions
PyPI · WWW/HTTP · released Apr 2025

A minimal low-level HTTP client library that sends HTTP requests with thread-safe and task-safe connection pooling, supporting HTTP/1.1, HTTP/2, proxies, and both sync and async interfaces.

BSD-3-Clausepure Python · 3.8+aging
783.6Mdownloads / mo
aiohttp Worth it
PyPI · WWW/HTTP · released Jul 2026

aiohttp is an async HTTP client and server framework built on asyncio, supporting both WebSockets and middleware-based routing for building concurrent web applications.

Install it if you need async HTTP client or server capabilities in asyncio-based applications.

permissive licensecompiled wheel · 3.10+
643.6Mdownloads / mo

See also soupsieve · tinycss2 · cssselect · selectolax · parsel · selectors2 · lxml · tinyhtml5 · elementpath · pyquery