I am attempting to click a button in a modal popup using xpath, like so:
self.driver.find_element_by_xpath('/html/body/div[17]/div/div/div[3]/button[2]').click()
I want to do this for a number of the same kind of elements essentially in sequence, one after another. As in, I run a series of clicks and form entries, and then this modal button appears. At this point, I click the button.
For some reason, after one or two successful button-clicking iterations, the button cannot be found by selenium:
ERROR:run_outbound:Message: no such element: Unable to locate element: {"method":"xpath","selector":"/html/body/div[17]/div/div/div[3]/button[2]"}
This is understandably confusing, I would appreciate any direction. I am using python3 and chromedriver with chrome version 80.0.3987.122