I am coding a bot for www.kith.com I have gotten past the card number and when I use the last 10 lines of code(name on card, expiration, security code)... I get this error,
"raise TimeoutException(message, screen, stacktrace)
TimeoutException'
before I added webdriver wait the code I was getting was init uses 3 arguments but 2 were given or something like that I'm relatively new to coding so this has kinda been a challenge.
code:
driver = webdriver.Chrome(executable_path=r'C:\webdrivers\Chromedriver.exe')
driver.get(str(url))
#size
driver.find_element_by_xpath('//div[@data-value="S"]').click()
#ATC
driver.find_element_by_xpath('//button[@class="btn product-form__add-to-cart"]').click()
time.sleep(6)
#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('99999')
#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)
#card number
driver.switch_to.frame(driver.find_element_by_class_name("card-fields-iframe"))
driver.find_element_by_id("number").send_keys('1234')
driver.find_element_by_id("number").send_keys('1234')
driver.find_element_by_id("number").send_keys('1234')
driver.find_element_by_id("number").send_keys('1234')
#payment
Exception(TimeoutException)
WebDriverWait(driver, 10).until(EC.frame_to_be_available_and_switch_to_it((By.XPATH,"//iframe[contains(@title,'Name on card')]")))
WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, "//input[@data-current-field]"))).send_keys('john')
driver.switch_to.default_content()
WebDriverWait(driver, 10).until(EC.frame_to_be_available_and_switch_to_it((By.XPATH,"//iframe[contains(@title,'Expiration date')]")))
WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, "//input[@data-current-field]"))).send_keys('11/23')
driver.switch_to.default_content()
WebDriverWait(driver, 10).until(EC.frame_to_be_available_and_switch_to_it((By.XPATH,"//iframe[contains(@title,'Security code')]")))
WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, "//input[@data-current-field]"))).send_keys('123')
driver.switch_to.default_content()
any suggestions would mean a lot to me. StackOverflow has helped me a ton so far. <3