我有以下HTML片段http://paste.enzotools.org/show/1209/,我想提取具有值为“172.80”(它是该片段的第四个节点)的文本()后裔的标记。我迄今为止的尝试一直是:XPath表达式问题
'descendant::td[@class="roomPrice figure" and contains(descendant::text(), "172.80")]'
'descendant::td[@class="roomPrice figure" and contains(div/text(), "172.80")]'
'descendant::td[@class="roomPrice figure" and div[contains(text(), "172.80")]]'
但他们都没有选择任何东西。 有没有人有任何建议?
临屋的HTML片段不是有效的XML/HTML - 有'是开头title'属性' Oded 2010-09-16 13:48:36
请修复您的代码。我收到错误:“错误:引用未声明的实体'nbsp'” – Topera 2010-09-16 13:49:47
您使用什么来应用这些XPath查询? jQuery的?硒?它很重要。 – LarsH 2010-09-16 14:20:31