Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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