Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
1.3 kB
2
Indexable
Never
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.chrome.options import Options
from time import sleep

url = "https://www.zalando.sk/vans-mid-skool-37-unisex-vysoke-tenisky-blanc-de-blancblack-va215n035-a11.html"

chrome_options = Options()
driver = webdriver.Chrome("C:\Program Files (x86)\chromedriver.exe",options=chrome_options)
driver.get(url)

dropdown = driver.find_element_by_id("picker-trigger")
dropdown.send_keys(Keys.SPACE,Keys.TAB,Keys.TAB,Keys.TAB,Keys.TAB,Keys.TAB,Keys.SPACE,Keys.TAB,Keys.SPACE)
sleep(1)
cookies = driver.find_element_by_id("uc-btn-accept-banner")
cookies.click()
driver.get("https://www.zalando.sk/cart")

kupon = driver.find_element_by_class_name("z-coast-base__collapsible-with-toggle-component__trigger")
kupon.click()
kod = driver.find_element_by_name("cart-redeem-coupon-input")
sleep(1)
kod.send_keys("NLW2V83JND")
kod.send_keys(Keys.TAB,Keys.SPACE)
sleep(1)

email = driver.find_element_by_id("login.email")
email.send_keys("moj email")
email = driver.find_element_by_id("login.secret")
email.send_keys("moje heslo")
email.send_keys(Keys.TAB,Keys.TAB,Keys.SPACE)
sleep(3)

pokladna = driver.find_element_by_id("z-1-button__content")
pokladna.click()