Does anyone know why when using Selenium - This for loop would iterate over my list and that at some point it just replaces all list elements with a single list element as some point. I'm not sure which index it decides to do it from addresses but at some point in the loop it will just replaced the addresses list items with just a single item and then it kills the loop. I have to recreate the list from the addresses list element # it stopped on. What could be happening? Thank you
addresses = ['address','address','address']
for addresses in addresses:
element = wait.until(EC.visibility_of_element_located((By.LINK_TEXT, 'text1')))
driver.find_element(By.LINK_TEXT, 'text2').click()
element = wait.until(EC.visibility_of_element_located((By.ID, 'text3')))
driver.find_element(By.ID,'idcustomername').send_keys(addresses[0])
driver.find_element(By.ID,'address').send_keys(addresses[1])
driver.find_element(By.ID, 'text4').click()
element = wait.until(EC.visibility_of_element_located((By.ID, 'text5')))
leads.append(driver.find_element(By.XPATH, '//div[@class="text6"]').text)
driver.find_element(By.ID, 'text7').click()