Skip to content
XPATH to CSS translator
Python JavaScript



Get your XPATHs translated to css automatically! (don't go to crazy on what you want to translate, this script is smart but won't do your breakfast).

[Build Status] [Sauce Status]


New! Use cssify from a browser:

From the console:

$ ./ '//a'
$ ./ '//a[@id="bleh"]'

From python:

>>> from cssify import cssify
>>> cssify('//a')
>>> cssify('//a[@id="bleh"]')

Testing and contributing

Supported and unsupported cases are documented by tests. If you have a request or a contribution for new conversions, include a test that proves the issue and solution and send a pull request.

To run all unit tests locally:

$ nosetests tests/

To run all Selenium tests locally (some env variables are necessary):

$ nosetests tests/
Something went wrong with that request. Please try again.