Вам нужно что-то вроде ниже:
context = d.find_element_by_xpath("//*[@attr='value']") # define context node
# Define descendants of context node
context.find_element_by_xpath("./descendant::xxx[contains(text(), 'my text')]")
context.find_element_by_xpath("./descendant::xxx[contains(text(), 'my other text')]")
Обратите внимание, что вам нужно указать точку в начале выражения XPath, чтобы указывать на узел контекста