click iteration fails in selenium
<p>Im trying to translate user comments from tripadvisor. So the scraper reads the link, then one by one iterates through each of the comments and translates them. But my code stops after translating the first comment itself.</p>

<pre><code>from selenium import webdriver
from selenium.webdriver.common.by import By
import time

driver = webdriver.Chrome()
driver.maximize_window()
driver.get("https://www.tripadvisor.in/ShowUserReviews-g1-d8729164-r425811350-TAP_Portugal-World.html")
gt= driver.find_elements(By.CSS_SELECTOR,".googleTranslation&gt;.link")
for i in gt:
    i.click()
    time.sleep(2)
    driver.find_element_by_class_name("ui_close_x").click()
    time.sleep(2)
</code></pre>

<p>I tried the same code of yours just increased the sleep time and list is getting traversed through the list and comments are also getting translated </p>

<p>Note: I tried the program on Firefox</p>

<pre><code>from selenium import webdriver
from selenium.webdriver.common.by import By
import time

driver = webdriver.Firefox()
driver.maximize_window()
driver.get("https://www.tripadvisor.in/ShowUserReviews-g1-d8729164-r425811350-TAP_Portugal-World.html")
gt= driver.find_elements(By.CSS_SELECTOR,".googleTranslation&gt;.link")
print(type(gt))
for i in gt:
    i.click()
    time.sleep(15)
    driver.find_element_by_class_name("ui_close_x").click()
    time.sleep(15)
</code></pre>

python selenium web-scraping