selectr: Translate CSS Selectors to XPath Expressions

Translates a CSS selector into an equivalent XPath expression. This allows us to use CSS selectors when working with the 'XML' and 'xml2' packages, which can only evaluate XPath expressions. Also provided are convenience functions for querying XML and HTML documents with CSS selectors. This package was originally a port of the Python package 'cssselect' (<https://cssselect.readthedocs.io/>).

Getting started

Package details

AuthorSimon Potter [aut, trl, cre], Simon Sapin [aut], Ian Bicking [aut]
MaintainerSimon Potter <simon@sjp.co.nz>
LicenseBSD_3_clause + file LICENCE
Version0.7-0
URL https://sjp.co.nz/projects/selectr/
Package repositoryView on CRAN
Installation Install the latest version of this package by entering the following in R:
install.packages("selectr")

Try the selectr package in your browser

Any scripts or data that you put into this service are public.

selectr documentation built on Sept. 17, 2026, 9:06 a.m.