Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
【Python】SeleniumでGmailにログインする方法
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
driver = webdriver.Firefox()
driver.implicitly_wait(10)
driver.get("https://mail.google.com/")
email = driver.find_element_by_name("Email")
email.send_keys("email")
email.send_keys(Keys.RETURN)
passwd = driver.find_element_by_name("Passwd");
passwd.send_keys("password")
passwd.send_keys(Keys.RETURN)
driver.quit()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment