I want to login to my gmail account using selenium. I use python2.7 . It doesn't have error, but the page said that I couldn't sign in to my account because some reason. you can see the screenshot below.
it is my code:
import time
import selenium
from selenium import webdriver
from selenium.webdriver.support.ui import Select
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
EXE_PATH = r'C:\Users\LENOVO\Downloads\geckodriver.exe'
driver = webdriver.Firefox(executable_path=EXE_PATH)
def login():
mail = 'myMail'
pw = 'myPassword'
driver.get('https://gmail.com')
email = driver.find_element_by_name('identifier')
email.send_keys(mail)
driver.find_element_by_id('identifierNext').click()
time.sleep(10)
password = driver.find_element_by_name('password')
password.send_keys(pw)
driver.find_element_by_id('passwordNext').click()
what have to I do? please help me, I just a noob and beginner. thanks master
Then when you run your code again with gmail authorization it should work fine.