I am trying to click on the "Next" button of a webpage, but I'm receiving an error. The steps I took to reach the table:
- Go to ibl.mdanderson.org/fasmic/#!
- Type and select AKT1 (3 mutations) (NOTE:'GO' button doesn't work, please click the option from the drop-down)
- Click on the green button with the text 'MS', a new table will appear.
- In this new table, there will be a tab called literature.
- At the end of the literature tab, there will be a "Next" button to go to the next page.
I need to parse data from the literature tab(which works perfectly). However, I cant go to the next page to parse data from the same table.
Following is the code:
driver.find_element_by_xpath("//*[contains(text(),'Literature')]").click()
for elements in driver.find_elements_by_css_selector("#literature_div [ng-repeat]"):
print(elements.text,"\n")
driver.implicitly_wait(5)
driver.find_element_by_xpath('//a[@ng-click="selectPage(page + 1, $event)"]').click()
After executing this, I get the following error:
"Message: The element reference of is stale; either the element is no longer attached to the DOM, it is not in the current frame context, or the document has been refreshed"