我有以下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