Xpath + regexp = hell

This commit is contained in:
Jannis Leidel
2012-05-19 15:38:38 +02:00
parent 9aa8f5a426
commit cd950ec925

View File

@@ -34,7 +34,7 @@ class LxmlParser(ParserBase):
def css_elems(self):
return self.tree.xpath(
'//meta[re:test(., "^link\[\@rel=\"stylesheet\"\]|style$", "i")]',
'//meta[re:test(., "^link\\[@rel=\\"stylesheet\\"\\]|style$", "i")]',
namespaces={"re": "http://exslt.org/regular-expressions"})
def js_elems(self):