I'm on a retailers web site and having trouble finding the CVV input field. Here's what I've tried.
searchXml = '//*[@id="payment-preferences"]/div[1]/fieldset/div[1]/div[2]/div[2]/input'
purchase = driver.find_element_by_xpath(searchXml)
Here's the error messages from the xpath search. I've also added several time.sleep() to slow down the script.
Traceback (most recent call last):
File "Selenium_test.py", line 106, in <module>
purchase = driver.find_element_by_xpath(searchXml)
File "/Users/claybogusky/Library/Python/3.8/lib/python/site-packages/selenium/webdriver/remote/webdriver.py", line 394, in find_element_by_xpath
return self.find_element(by=By.XPATH, value=xpath)
File "/Users/claybogusky/Library/Python/3.8/lib/python/site-packages/selenium/webdriver/remote/webdriver.py", line 976, in find_element
return self.execute(Command.FIND_ELEMENT, {
File "/Users/claybogusky/Library/Python/3.8/lib/python/site-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "/Users/claybogusky/Library/Python/3.8/lib/python/site-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"//*[@id="payment-preferences"]/div[1]/fieldset/div[1]/div[2]/div[2]/input"}
(Session info: chrome=89.0.4389.114)
Thanks!!
DOM from page it shows an iFrame.