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
#2
it would probably be easier with selenium to login and get the page content and then pass it to BS
from selenium import webdriver
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)
browser.get(login_url)
time.sleep(2)
browser.find_element_by_id("identifierId").send_keys(EMAIL)
browser.find_element_by_id("identifierNext").click()
time.sleep(2)
browser.find_element_by_name("password").send_keys(PASSWORD)
browser.find_element_by_id("passwordNext").click()
time.sleep(2)

soup = BeautifulSoup(browser.page_source, 'html.parser')
Recommended Tutorials:
Reply


Messages In This Thread
RE: How to enter value in gmail id and password - by metulburr - Nov-01-2017, 03:38 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Gmail API - Error 400: redirect_uri_mismatch Depp 1 2,363 Jun-12-2022, 10:42 AM
Last Post: snippsat
  find a hyperlink in Gmail body python 3(imap and selenium) taomihiranga 1 9,376 Dec-30-2020, 05:31 PM
Last Post: Gamer1057
  Not able to sign into gmail using selenium Leo_Red 4 9,086 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 2,561 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,736 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