How to use the selectolax.parser function in selectolax

To help you get started, we’ve selected a few selectolax 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 lorien / ioweb / ioweb / response.py View on Github external
def slax_dom(self):
        if not SELECTOLAX_IMPORTED:
            raise ImportError('Could not import selectolax.parser. Install selectolax package')
        else:
            if self._cached_selectolax_dom is None:
                # pytype: disable=name-error
                self._cached_selectolax_dom = selectolax.parser.HTMLParser(
                    self.data.replace(b'\x00', b'')
                )
                # pytype: enable=name-error
            return self._cached_selectolax_dom

selectolax

Fast HTML5 parser with CSS selectors.

MIT
Latest version published 14 days ago

Package Health Score

82 / 100
Full package analysis

Similar packages