feeds: exotic xpath in html as well
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
c524e54d2d
commit
c8669002e4
|
@ -488,7 +488,14 @@ class ParserHTML(ParserXML):
|
||||||
repl = r'[@class and contains(concat(" ", normalize-space(@class), " "), " \1 ")]'
|
repl = r'[@class and contains(concat(" ", normalize-space(@class), " "), " \1 ")]'
|
||||||
rule = re.sub(pattern, repl, rule)
|
rule = re.sub(pattern, repl, rule)
|
||||||
|
|
||||||
return self.root.xpath(rule)
|
match = self.root.xpath(rule)
|
||||||
|
|
||||||
|
if isinstance(match, str):
|
||||||
|
# for some xpath rules, see XML parser
|
||||||
|
return [match,]
|
||||||
|
|
||||||
|
else:
|
||||||
|
return match
|
||||||
|
|
||||||
except etree.XPathEvalError:
|
except etree.XPathEvalError:
|
||||||
return []
|
return []
|
||||||
|
|
Loading…
Reference in New Issue