from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from getpass import getpass
import time
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as ec
username = input("Enter the Email: ")
password = input("Enter Password: ")
driver = webdriver.Chrome("C:\Python38\chromedriver.exe")
driver.get("https://account.xbox.com/en-us/profile?gamertag=Lol%20u%20Ps4%20Pleb")
username_textbox = driver.find_element_by_id("i0116")
username_textbox.send_keys(username)
time.sleep(3)
login_button = driver.find_element_by_id("idSIButton9")
login_button.click()
time.sleep(4)
personal_account = driver.find_element_by_id("msaTileTitle")
personal_account.click()
time.sleep(4)
password_textbox = driver.find_element_by_id("i0118")
password_textbox.send_keys(password)
time.sleep(4)
login_button = driver.find_element_by_id("idSIButton9")
login_button.submit()
time.sleep(7)
print(driver.title)
add_friend = driver.find_elements_by_id("addfriendactionbutton")
add_friend.click()
print("Added Friend Success")
time.sleep(3)
quit