I have an element with changing text.
<small class="cell progress-name text-center ng-star-inserted">*some changing text*</small>
After the text in this element disappears, the element also disappears. I need to find a way out of while loop after an element has disappeared.
previous_value = None
while True:
current_value = browser.find_element_by_xpath('//*[@class="cell progress-name text-center ng-star-inserted"]')
if previous_value:
if current_value.text != previous_value:
print(current_value.text)
previous_value = current_value.text
else:
print(current_value)
previous_value = current_value.text
time.sleep(1)
Now I get no such element: Unable to locate element error message and any help would be appreciated.