我的大多数编码对于创建“ kith” shopify自动购买工具都进展顺利。但是,当我进入付款页面并搜索卡号时,出现错误“未定义驱动程序”。
示例代码...
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')
任何想法都会有所帮助。最后两行代码是我遇到问题的地方。 www.kith.com付款页面