WebDriverWait until_not and invisibility too slow on Python and Selenium

692 Views Asked by At

I have a page where a loader "ajax-disable" which appears for around 5-6 seconds and if everything is ok it disappers. I have the following code:

try:
  WebDriverWait(driver, 30).until_not(EC.presence_of_element_located((By.CSS_SELECTOR, ".ajax-disable")))
  print("Finished")
except:
  print("ERROR")

I tried both until_not and invisibility_of_element_located but no difference. So my problem is that it is too slow after the loader ".ajax-disable" disappears there is a wait of around 10 more seconds until it prints "Finished" any idea why and how to make it faster so right after the loader disappears to continue? Also changed the timeout from 5 to 100 seconds but still the same.

0

There are 0 best solutions below