for i in range(len(tlds)):
#print("TLD at index " + str(i) + " is " + tlds[i])
try:
print("Cerca sito...")
sito = WebDriverWait(driver, 0.2).until(EC.presence_of_element_located((By.XPATH, "//div[contains(text(),'" + str(tlds[i]) +"') and @class ='Io6YTe fontBodyMedium']"))).text
except:
#print("T1")
sito = None
if sito is not None:
print("T2")
break
Here is the code: the part that is taking me so long is sito=...
it cycles correctly through the loop but takes so much
I printed the result of site and actually it's correct: prints the tlds[i]
between quotation marks but just takes so long.