I'm trying to iterate through this list and select the element, can't figure it out.
Code trials:
butonlista = self.wait.until(EC.element_to_be_clickable((By.XPATH, "//input[@id='P17_OWNER01_EMAIL_AD']")))
butonlista.click()
search_result = self.wait.until(EC.presence_of_all_elements_located((By.XPATH, "(//ul[@role='listbox'])[1]")))
print(len(search_result))
for result in search_result:
if "bacau@otpbank.ro" in result.text:
result.click()
break
But print(len(search_result))
returns 1 element, what am I doing wrong?
Snapshot of the HTML: