I'm running into trouble with using xpath to find elements/nodes, particularly due to a sanitization problem.
An element I am trying to manually locate for this problem:
<h2>
<span class="mw-headline" id="030:_"Harpie's_Pet_Dragon"">030: "Harpie's Pet Dragon"</span>
</h2>
I'm trying to do this a couple different ways:
xpath("//span[@id='030:_Harpie\'s_Pet_Dragon']")
xpath("//span[@id=\"030:_\"Harpie's_Pet_Dragon\"\"]")
They all return:
Traceback (most recent call last):
File "<input>", line 1, in <module>
x.xpath("//span[@id=\"030:_\"Harpie's_Pet_Dragon\"\"]")
File "src/lxml/etree.pyx", line 1623, in lxml.etree._Element.xpath
File "src/lxml/xpath.pxi", line 290, in lxml.etree.XPathElementEvaluator.__call__
File "src/lxml/xpath.pxi", line 210, in lxml.etree._XPathEvaluatorBase._handle_result
lxml.etree.XPathEvalError: Invalid predicate