Actually, the question is not very clear. How about this :
//span[.='Amount']/following-sibling::div[contains(@class,'detailsValue')]]
Above XPath will search for <span>
element with text equals "Amount"
, then get it's following <div>
sibling having class contains "detailsValue"
UPDATE :
According to your comment, if I don't misunderstand it, you want both value (div after Amount
span and div after Date
span). Try this XPath :
//span[.='Amount' or .='Date']/following-sibling::div[contains(@class, 'detailsValue')]