Issue
I am getting this error:
"selenium.common.exceptions.ElementNotInteractableException: Message: Element could not be scrolled into view"
This is the code i am using:
driver.find_element_by_xpath('//*[@class="next"]').click()
This is from the inspector:
Can you please let me know how to click on "Next"?
Many thanks.
Solution
Looks like this element is located out of the initially visible screen when you open that page with Selenium.
Try scrolling it into the view and then clicking it with the following code:
from selenium.webdriver.common.action_chains import ActionChains
actions = ActionChains(driver)
pager = driver.find_element_by_xpath('//li[@class="next"]')
actions.move_to_element(pager).perform()
time.sleep(0.5)
pager.click()
Answered By - Prophet
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.