I am trying to automate a Google Chrome session in Python using Selenium. Until now, I have been using an extension to get the xpath, which works OK. But now, I encounter an error when using the xpath I have located:
NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"//*[@id="ok"]"} (Session info: chrome=71.0.3578.98) (Driver info: chromedriver=2.45.615291 (ec3682e3c9061c10f26ea9e5cdcf3c53f3f74387),platform=Windows NT 6.3.9600 x86_64)
The line that returns an error looks like this:
browser.find_element_by_xpath('//*[@id="ok"]').click()
Unfortunately, the button I need to click is pretty deep within a webpage and requires a certain plugin, which makes it hard for you to replicate the flow of my program. Therefore, I have uploaded an image of the source code of the webpage (The blue line is the button I would like to click):
Could you provide some help on how to correct the selenium selector, so that I will be able to click the element?