Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def xpath(css):
return _unicode(GenericTranslator().css_to_xpath(css, prefix=''))
def parse_pseudo(css):
result = []
for selector in parse(css):
pseudo = selector.pseudo_element
# No Symbol here
assert pseudo is None or type(pseudo) is _unicode
selector = repr(selector.parsed_tree).replace("(u'", "('")
result.append((selector, pseudo))
return result
def parse_pseudo(css):
result = []
for selector in parse(css):
pseudo = selector.pseudo_element
pseudo = _unicode(pseudo) if pseudo else pseudo
# No Symbol here
assert pseudo is None or type(pseudo) is _unicode
selector = repr(selector.parsed_tree).replace("(u'", "('")
result.append((selector, pseudo))
return result
def xpath(css):
return _unicode(CustomTranslator().css_to_xpath(css))
def parse_pseudo(css):
result = []
for selector in parse(css):
pseudo = selector.pseudo_element
pseudo = _unicode(pseudo) if pseudo else pseudo
# No Symbol here
assert pseudo is None or type(pseudo) is _unicode
selector = repr(selector.parsed_tree).replace("(u'", "('")
result.append((selector, pseudo))
return result
def xpath(css):
return _unicode(GenericTranslator().css_to_xpath(css, prefix=''))