Python Selenium keeping elements after changed browser

Viewed 1431

I'm currently using Selenium on Python and have got a question about it.

elements = driver.find_elements_by_css_selector("div.classname a")
for element in elements:
    element.click()
    driver.back()

Since coming back to the previous page using back() in this code, Selenium couldn't find elements anymore, even though I still need it.

If someone has got any clue, please help me out.

Many appreciate in advance

2 Answers
Related