2011-07-20 107 views

回答

1

使用//*p[@class = 'special-price']/*[@class = 'price']//*[@class = 'price' and ../@class = 'special-price']

+1

感謝馬丁的回答! 第二個對我來說工作得很好。我也發現了以下方法,但你的時間要短得多。 parent :: node()[@ class ='price-box'] – Adrien

2
//*[@class='special-price']/*[@class='price'] 

如果你無論如何搜索整個文檔,然後過濾家長途中的孩子,而不是選擇孩子,然後回到了檢查父。

+0

感謝您的回答。但我確實需要選擇孩子,然後回到特定的情況。這是對我有用的: (..)// * [@ class ='old-price'or @ class ='price-excluded-tax'and ../@ class ='price-box']( ..) – Adrien

相關問題