I am trying to append the name of a value which it's child element is less then 120.
My code is
list = []
rate = driver.find_elements(By.XPATH, '//span[@class="sFive"]')
for e in rate:
if int(e.text) < 120:
title=e.find_element(By.XPATH, x).text #find ancestor element
list.append(title)
print(list)
The x is where I need to find the grandparent which is the 21st span element up that branch.
The span element is
<span data-slnm="Brand" class="ng-star-inserted">Inter</span>