from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.by import By
#크롬 드라이버 자동 업데이트
from webdriver_manager.chrome import ChromeDriverManager
import time
import pyautogui
import pyperclip
#브라우저 꺼짐 방지
cheome_options = Options()
cheome_options.add_experimental_option("detach",True)
service = Service(executable_path=ChromeDriverManager().install())
driver = webdriver.Chrome(service=service, options=cheome_options)
#웹페이지 이동
driver.implicitly_wait(5)
driver.maximize_window()
driver.get("https://nid.naver.com/nidlogin.login?mode=form&url=https%3A%2F%2Fwww.naver.com")
#아이디
id = driver.find_element(By.CSS_SELECTOR,"#id")
id.click
pyperclip.copy("abcdefg")
pyautogui.hotkey("ctrl", "v")
time.sleep(5)
#비밀번호 입력
pw = driver.find_element(By.CSS_SELECTOR,"#pw")
pw.click
pyperclip.copy("1234567")
pyautogui.hotkey("ctrl", "v")
time.sleep(2)
#fhrmdls qjxms
login_btn = driver.find_element(By.CSS_SELECTOR,"#log\.login")
login_btn.click