Selenium: How to click on all DIVs with same class name
<p>I've been working on scraping a site which has usually 10 to 12 DIVs with the same class name. When clicked on any one of these DIVs, it goes to a new page. I want to scrape data from that page and then navigate back to previous page and then click on the next div and so on.</p>

<p>But I can't figure out that when I come back to the previous page how can I click on the next div?</p>

<p>Any help would be appreciated.</p>

<pre><code>matches = browser.find_elements_by_class_name('ipo-CompetitionBase ')
index = 0
while index &lt;= len(matches):
    matches[index].click()
    browser.back()
    index += 1
</code></pre>