from selenium.webdriver import ActionChains
from selenium.webdriver.common.by import By
from selenium import webdriver

Amazon_site = ('https://www.amazon.com/')
Sing_In_btn =(By.CSS_SELECTOR,'a#nav-link-accountList')
Email_fild = (By.ID, 'ap_email')
Email_Continue_Btn = (By.ID, 'continue')
Password_fild = (By.ID,'ap_password')
Password_Continue_Btn = (By.ID, 'signInSubmit')
Hamburger_menu =(By.CSS_SELECTOR,"a#nav-hamburger-menu")
Best_sell_menu=(By.CSS_SELECTOR,"a[href*='bestsellers_0_1_1_2']")
Best_sell_items = (By.ID,'zg_left_col1')
Card_Btn = (By.ID,'gc-buy-box-atc')
Item = (By.ID,"productTitle")

driver= webdriver.Chrome()
driver.maximize_window()
driver.implicitly_wait(10)

#OPen URL and click sing_in
driver.get(Amazon_site)
sing_in= driver.find_element(*Sing_In_btn).click()

#write email and click
email= driver.find_element(*Email_fild)
email.clear()
email.send_keys('Lion7500000@gmail.com')
driver.find_element(*Email_Continue_Btn).click()

#write password and click
password = driver.find_element(*Password_fild)
password.clear()
password.send_keys('Andrii960926')
driver.find_element(*Password_Continue_Btn).click()

#clik to hamb_menu and click best_sell menu
Hum_menu = driver.find_element(*Hamburger_menu).click()
Best_sell = driver.find_element(*Best_sell_menu).click()

# #clik fist item and add to card
# best_items = driver.find_element(*Best_sell_items).click()
# driver.find_element(*Card_Btn).click()
# text_item = driver.find_element(*Item).text
# print (text_item)


