I got it to work using xpath instead of link text. As my links were in one column in a table, i just had to change the row number in the xpath for each iteration. As xpath will remain constant even if the page is reloaded (this i am concluding because..), this code works.
views = browser.find_elements_by_link_text('View') a = len(views) + 1 views = browser.find_element_by_xpath('//form/div[3]/center/div[3]/table/tbody/tr[4]/td/div[1]/table/tbody/tr[' + str(a) + ']/td[4]/a') while a > 1: #to exclude the header row window_before = browser.window_handles[0] views.click() browser.switch_to_window(window_before) a -= 1 if a != 1: views = browser.find_element_by_xpath('//form/div[3]/center/div[3]/table/tbody/tr[4]/td/div[1]/table/tbody/tr[' + str(a) + ']/td[4]/a'):)