Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ### SOLEBOX.PY 1.0 CODING UTF-8 ###
- ### 26.09.2017 ###
- from selenium import webdriver
- import time
- path_to_chromedriver = 'C:\\Users\saarb\Downloads\chromedriver.exe' # change path as needed
- browser = webdriver.Chrome(executable_path = path_to_chromedriver)
- browser_1 = webdriver.Chrome(executable_path = path_to_chromedriver)
- url = 'https://www.solebox.com/adidas-NMD/NMD-R2-PK-variant-7.html' # change as needed
- url_1 = 'https://www.solebox.com/mein-konto/'
- url_2 = 'https://www.solebox.com/warenkorb/'
- browser.get(url)
- browser_1.get(url)
- browser.find_element_by_xpath('//*[@id="14694"]').click() # change as needed hmu for more instructions
- browser_1.find_element_by_xpath('//*[@id="14694"]').click() # change as needed hmu for more instructions
- browser.find_element_by_xpath('//*[@id="toBasket"]/span[2]').click()
- browser_1.find_element_by_xpath('//*[@id="toBasket"]/span[2]').click()
- browser.get(url_1)
- browser_1.get(url_1)
- browser.find_element_by_xpath('//*[@id="optionLogin"]/form/ul/li[1]/input[7]').send_keys('kurtz_kevin@web.de')
- browser_1.find_element_by_xpath('//*[@id="optionLogin"]/form/ul/li[1]/input[7]').send_keys('kurtz_kevin@web.de') # account required
- browser.find_element_by_xpath('//*[@id="optionLogin"]/form/ul/li[2]/input').send_keys('xxxx')
- browser_1.find_element_by_xpath('//*[@id="optionLogin"]/form/ul/li[2]/input').send_keys('xxxx') # password
- browser.find_element_by_xpath('//*[@id="optionLogin"]/form/ul/li[4]/button').click()
- browser_1.find_element_by_xpath('//*[@id="optionLogin"]/form/ul/li[4]/button').click()
- browser.get(url_2)
- browser_1.get(url_2)
- browser.find_element_by_xpath('//*[@id="content"]/div/div[2]/form[2]/button').click()
- browser_1.find_element_by_xpath('//*[@id="content"]/div/div[2]/form[2]/button').click()
- browser.find_element_by_xpath('//*[@id="userNextStepBottom"]').click()
- browser_1.find_element_by_xpath('//*[@id="userNextStepBottom"]').click()
- browser.find_element_by_xpath('//*[@id="paymentCenter"]/div[1]/dl[2]/dt/div[2]/label').click()
- browser_1.find_element_by_xpath('//*[@id="paymentCenter"]/div[1]/dl[2]/dt/div[2]/label').click()
- browser_1.find_element_by_xpath('//*[@id="paymentNextStepBottom"]').click()
- success = browser.find_element_by_xpath('//*[@id="paymentNextStepBottom"]').click()
- if success == True:
- print("Failed! Check browser")
- else:
- print("Checkout success!")
- #time.sleep(4) #paypal checkout needs to be fixed
- #browser.find_element_by_xpath('//*[@id="loginSection"]/div/div[2]/a').click()
- #browser.find_element_by_xpath('//*[@id="email"]').send_keys('test@gmail.com')
- #browser.find_element_by_xpath('//*[@id="btnNext"]').click()
- #browser.find_element_by_xpath('//*[@id="btnLogin"]').click()
- #browser_1.find_element_by_xpath('//*[@id="email"]').send_keys('test@gmail.com')
- #browser_1.find_element_by_xpath('//*[@id="password"]"]').send_keys('Test12345')
- #
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement