I have just started with selenium. Now I have all the links that I want to click.This links lead me to a Page that I want to scrape. When the driver click on the first link it works perfectly fine but on second link click I get the message as :
Message: stale element reference: element is not attached to the page document
def view_All_pages(driver , file_object):
#All the Links that i want to click
list_of_links = driver.find_elements_by_xpath("//a[@class='@ClassName']")
for link in list_of_links:
time.sleep(10)
link.click() #Getting the error here
scraping_Normal_page(driver , file_object)
driver.back()
I want to scrape the the page and come back to the opening page and then click on to the next link. Help will be appreciated