I am trying to wait for the loading spinner to finish loading and then perform some operation
My Code looks like
try:
while driver.find_element(By.CSS_SELECTOR, "div.content-container div.content-element-container > div.loading-container").is_displayed() == True:
time.sleep(10)
driver.refresh()
if count > 3:
print("Could not fetch content")
exit(1)
count += 1
except Exception as e:
print(str(e))
the reason for driver refresh is because of signal-r. For some reason the i do not get the data and the load spinner keeps on loading and then prints "Could Not fetch content").
If I refresh the page then I get NoSuchElementException
. What would be the best way to handle such a scenario?