selenium.common.exceptions.StaleElementReferenceException: Message:
element reference: element is not attached to the page document
The page is loaded using JavaScript. On the page, there is a button "show more". When I click on this button, the data is displayed and the same "show more" button appears. This can continue many times. I can only click on the first button "show more", but on the following one does not work. I noticed that when the button is out of sight of the screen, then this exception arises!
driver.execute_script ("arguments [0] .scrollIntoView ()" does not work.
more_info [i] .WebDriverWait (driver, 3) .until(EC.element_to_be_clickable (By.CSS_SELECTOR, "selector")) doesn't work
more_info.location_once_scrolled_into_view
Please help me! i am begginer
my cod: (more_info is driver.find_elements(By.CSS_SELECTOR)
def more_foo(more_info):
more_info.location_once_scrolled_into_view
more_info.send_keys(Keys.CONTROL, Keys.ENTER)
time.sleep(2)