The code below runs perfectly, but after 10 seconds I get an exception (which says the element is not found), and thats because the element is getting refreshed. it takes less than 1 seconds to get refreshed. So all I need to do, is wait when its getting refreshed, and then continue.
items = driver.find_elements_by_class_name('box')
for item in items:
while True:
try:
title = item.find_element_by_class_name('title').text
break
except:
time.sleep(4)
pass
I tried to solve it with try: except: but once it joins the except part, it gets stuck in the loop. How do we solve this?