hxs.select("//h:h2[re:test(., 'a', 'i')]").extract()
Undefined namespace prefix
xmlXPathEval: evaluation failed
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/scrapy/selector/libxml2sel.py", line 44, in select
raise ValueError("Invalid XPath: %s" % xpath)
ValueError: Invalid XPath: //h:h2[re:test(., 'a', 'i')]
我是 XPath 和 Scrapy 的新手。
它出什么问题了?(我正在尝试选择包含单词“a”的节点)。