May-16-2020, 03:17 PM
Why would you expect the while loop to end? "while True" runs forever and there is no code to break out of the while. You could try writing your code like this:
try: while True : element1=driver.find_element_by_xpath(f[i]) driver.find_element_by_xpath(f[i]).click() import time time.sleep(1) except ValueError: print("no more clicks")