< 선수 작업 >
1. Python - selenium 설치
- cmd -> pip install selenium
2. Google Chromedriver 다운로드
http://chromedriver.chromium.org/downloads
3. C:\chromedriver 생성 후 다운로드 풀기
< 자동 로그인 코드 >
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
driver = webdriver.Chrome('C:/chromedriver/chromedriver')
driver.implicitly_wait(3)
# gmail.com
driver.get('https://accounts.google.com/ServiceLogin/identifier?service=mail&passive=true&rm=false&continue=https%3A%2F%2Fmail.google.com%2Fmail%2F&ss=1&scc=1<mpl=default<mplcache=2&emr=1&osid=1&flowName=GlifWebSignIn&flowEntry=AddSession')
driver.find_element_by_name('identifier').send_keys('구글계정')
driver.find_element_by_xpath('//*[@id="identifierNext"]/content/span').click()
driver.find_element_by_name('password').send_keys('구글패스워드')
driver.find_element_by_xpath('//*[@id="passwordNext"]').send_keys(Keys.ENTER)
< 실행 화면 >
'Python_Intermediate > Automation' 카테고리의 다른 글
Gmail Python Send(Add File) (0) | 2019.04.06 |
---|---|
Python - webdriver headless Mode(창 숨김 모드) (0) | 2019.03.06 |
Python - NaverMail 제목 리스트 가져오기 (0) | 2019.03.03 |
Python - DaumMail 제목 리스트 가져오기 (0) | 2019.03.03 |
Python - DaumMail Auto Login(다음 메일 자동 로그인) (0) | 2019.03.03 |