Advertisement
Guest User

Untitled

a guest
Feb 25th, 2018
352
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.82 KB | None | 0 0
  1. ### SOLEBOX.PY 1.0 CODING UTF-8 ###
  2. ### 26.09.2017 ###
  3.  
  4. from selenium import webdriver
  5. import time
  6.  
  7. path_to_chromedriver = 'C:\\Users\saarb\Downloads\chromedriver.exe' # change path as needed
  8. browser = webdriver.Chrome(executable_path = path_to_chromedriver)
  9. browser_1 = webdriver.Chrome(executable_path = path_to_chromedriver)
  10. url = 'https://www.solebox.com/adidas-NMD/NMD-R2-PK-variant-7.html' # change as needed
  11. url_1 = 'https://www.solebox.com/mein-konto/'
  12. url_2 = 'https://www.solebox.com/warenkorb/'
  13. browser.get(url)
  14. browser_1.get(url)
  15. browser.find_element_by_xpath('//*[@id="14694"]').click() # change as needed hmu for more instructions
  16. browser_1.find_element_by_xpath('//*[@id="14694"]').click() # change as needed hmu for more instructions
  17. browser.find_element_by_xpath('//*[@id="toBasket"]/span[2]').click()
  18. browser_1.find_element_by_xpath('//*[@id="toBasket"]/span[2]').click()
  19. browser.get(url_1)
  20. browser_1.get(url_1)
  21. browser.find_element_by_xpath('//*[@id="optionLogin"]/form/ul/li[1]/input[7]').send_keys('kurtz_kevin@web.de')
  22. browser_1.find_element_by_xpath('//*[@id="optionLogin"]/form/ul/li[1]/input[7]').send_keys('kurtz_kevin@web.de') # account required
  23. browser.find_element_by_xpath('//*[@id="optionLogin"]/form/ul/li[2]/input').send_keys('xxxx')
  24. browser_1.find_element_by_xpath('//*[@id="optionLogin"]/form/ul/li[2]/input').send_keys('xxxx') # password
  25. browser.find_element_by_xpath('//*[@id="optionLogin"]/form/ul/li[4]/button').click()
  26. browser_1.find_element_by_xpath('//*[@id="optionLogin"]/form/ul/li[4]/button').click()
  27. browser.get(url_2)
  28. browser_1.get(url_2)
  29. browser.find_element_by_xpath('//*[@id="content"]/div/div[2]/form[2]/button').click()
  30. browser_1.find_element_by_xpath('//*[@id="content"]/div/div[2]/form[2]/button').click()
  31. browser.find_element_by_xpath('//*[@id="userNextStepBottom"]').click()
  32. browser_1.find_element_by_xpath('//*[@id="userNextStepBottom"]').click()
  33. browser.find_element_by_xpath('//*[@id="paymentCenter"]/div[1]/dl[2]/dt/div[2]/label').click()
  34. browser_1.find_element_by_xpath('//*[@id="paymentCenter"]/div[1]/dl[2]/dt/div[2]/label').click()
  35. browser_1.find_element_by_xpath('//*[@id="paymentNextStepBottom"]').click()
  36. success = browser.find_element_by_xpath('//*[@id="paymentNextStepBottom"]').click()
  37. if success == True:
  38. print("Failed! Check browser")
  39. else:
  40. print("Checkout success!")
  41. #time.sleep(4) #paypal checkout needs to be fixed
  42. #browser.find_element_by_xpath('//*[@id="loginSection"]/div/div[2]/a').click()
  43. #browser.find_element_by_xpath('//*[@id="email"]').send_keys('test@gmail.com')
  44. #browser.find_element_by_xpath('//*[@id="btnNext"]').click()
  45. #browser.find_element_by_xpath('//*[@id="btnLogin"]').click()
  46. #browser_1.find_element_by_xpath('//*[@id="email"]').send_keys('test@gmail.com')
  47. #browser_1.find_element_by_xpath('//*[@id="password"]"]').send_keys('Test12345')
  48. #
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement