Python Forum
How to enter value in gmail id and password
Thread Rating:
  • 1 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to enter value in gmail id and password
#6
the time it takes to load a webpage can be different for each person, depending on your internet speed and computer, etc.

@OP I added the above example in for wait until elements
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
from bs4 import BeautifulSoup
import time
 
EMAIL = ''
PASSWORD = ''
CHROMEPATH = ''
 
login_url = 'https://www.google.com/accounts/Login'
browser = webdriver.Chrome(CHROMEPATH)
browser.set_window_position(0,0)
wait = WebDriverWait(browser, 2)
presence = EC.presence_of_element_located
visible = EC.visibility_of_element_located

browser.get(login_url)

wait.until(presence((By.ID, 'identifierId')))
browser.find_element_by_id("identifierId").send_keys(EMAIL)
browser.find_element_by_id("identifierNext").click()

wait.until(presence((By.NAME, 'password')))
browser.find_element_by_name("password").send_keys(PASSWORD)
browser.find_element_by_id("passwordNext").click()

wait.until(visible((By.CSS_SELECTOR, '#gb > div.gb_zd.gb_5d > div.gb_yc.gb_lb.gb_xc.gb_Zd > div > div.gb_ib.gb_4c.gb_yg.gb_R.gb_pf.gb_pb > div > a > span')))
soup = BeautifulSoup(browser.page_source, 'html.parser')
print(soup.prettify())
Recommended Tutorials:
Reply


Messages In This Thread
RE: How to enter value in gmail id and password - by metulburr - Nov-02-2017, 11:49 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Gmail API - Error 400: redirect_uri_mismatch Depp 1 1,593 Jun-12-2022, 10:42 AM
Last Post: snippsat
  find a hyperlink in Gmail body python 3(imap and selenium) taomihiranga 1 8,184 Dec-30-2020, 05:31 PM
Last Post: Gamer1057
  Not able to sign into gmail using selenium Leo_Red 4 5,836 Nov-19-2020, 05:03 AM
Last Post: Leo_Red
  How to send notifications to gmail from contact form using Django and pushbullet Justchse 0 1,868 Sep-01-2020, 01:19 PM
Last Post: Justchse
  Send email to gmail after user fill up contact form and getting django database updat Man_from_India 0 2,107 Jan-22-2020, 03:59 PM
Last Post: Man_from_India

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020