The majority of my coding has gone well for creating a "kith" shopify automated purchasing tool. However, when I get to the payment page and search for the card number I get the error "driver not defined".
ex of code...
driver = webdriver.Chrome(executable_path=r'C:\webdrivers\Chromedriver.exe')
driver.get(str(url))
#size
driver.find_element_by_xpath('//div[@data-value="M"]').click()
#ATC
driver.find_element_by_xpath('//button[@class="btn product-form__add-to-cart"]').click()
time.sleep(6)
# x out of pop up
driver.find_element_by_xpath('//button[@alt="Close form"]').click()
#checkout
driver.find_element_by_xpath('//button[@class="btn ajaxcart__checkout"]').click()
time.sleep(3)
#email
driver.find_element_by_xpath('//input[@placeholder="Email"]').send_keys('example@gmail.com')
#first
driver.find_element_by_xpath('//input[@placeholder="First name"]').send_keys('first')
#last
driver.find_element_by_xpath('//input[@placeholder="Last name"]').send_keys('last')
#address
driver.find_element_by_xpath('//input[@placeholder="Address"]').send_keys('address')
#city
driver.find_element_by_xpath('//input[@placeholder="City"]').send_keys('town')
#zip
driver.find_element_by_xpath('//input[@placeholder="ZIP code"]').send_keys('zip')
#phone number
driver.find_element_by_xpath('//input[@placeholder="Phone"]').send_keys('9999999999' + u'\ue007')
time.sleep(5)
#continue to payment
driver.find_element_by_xpath('//button[@type="submit"]').click()
time.sleep(8)
#payment page
driver.find_element_by_class_name('//iframe[@class="card-fields-iframe"]')
driver.find_element_by_xpath('//input[@placeholder="Card number" and @id= "number"]').send_keys('1234567812345678')
any ideas would help. The last 2 lines of code is where I get my problem. www.kith.com payment page