• Stars
    star
    132
  • Rank 272,647 (Top 6 %)
  • Language
    Python
  • License
    MIT License
  • Created over 13 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

XPATH to CSS translator

cssify

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]

Usage

New! Use cssify from a browser:

http://cssify.appspot.com

Install:

$ pip install cssify

From python:

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

From the console:

$ ./cssify.py '//a'
a
$ ./cssify.py '//a[@id="bleh"]'
a#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/test_cssify.py

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

$ nosetests tests/test_cssify_web.py