How to use the cssselect.parser.tokenize function in cssselect

To help you get started, we’ve selected a few cssselect examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mozilla / fjord / vendor / packages / cssselect / cssselect / tests.py View on Github external
def test_tokenizer(self):
        tokens = [
            _unicode(item) for item in tokenize(
                u(r'E\ é > f [a~="y\"x"]:nth(/* fu /]* */-3.7)'))]
        assert tokens == [
            u(""),
            "<s>",
            "' at 5&gt;",
            "<s>",
            # the no-break space is not whitespace in CSS
            u(""),  # f\xa0
            "",
            "",
            "",
            "",
            "",
            "",
            "",</s></s>
github zopyx / print-css-rocks / lessons / in-progress / lesson-multi-column-float-to-landscape / lib / python3.4 / site-packages / cssselect / tests.py View on Github external
def test_tokenizer(self):
        tokens = [
            _unicode(item) for item in tokenize(
                u(r'E\ é &gt; f&nbsp;[a~="y\"x"]:nth(/* fu /]* */-3.7)'))]
        assert tokens == [
            u(""),
            "<s>",
            "' at 5&gt;",
            "<s>",
            # the no-break space is not whitespace in CSS
            u(""),  # f\xa0
            "",
            "",
            "",
            "",
            "",
            "",
            "",</s></s>