Skip to content

Instantly share code, notes, and snippets.

@kurozumi
Last active February 14, 2016 05:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kurozumi/15706d050b66a5fe3629 to your computer and use it in GitHub Desktop.
Save kurozumi/15706d050b66a5fe3629 to your computer and use it in GitHub Desktop.
【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