Lucas Brum
08/24/2022, 3:41 PMKevin Grismore
08/24/2022, 3:41 PMLucas Brum
08/24/2022, 4:08 PMKevin Grismore
08/24/2022, 4:13 PMrequests
packageLucas Brum
08/24/2022, 5:23 PMfrom bs4 import BeautifulSoup
import requests
my_email = "email" # my email is here
my_pass = "password" # my password is here
url = "<https://accounts.google.com/o/oauth2/auth?response_type=code&client_id=105273681273-sbo8hk12smk1uh2jgii9v09i4kf1ns24.apps.googleusercontent.com&redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fadwords&state=MyEVvIsAytjJjqXvqeOyUA1ZjiJF4R&prompt=consent&access_type=offline>"
form_data = {'Email': my_email, 'Passwd': my_pass}
post = "<https://accounts.google.com/signin/challenge/sl/password>"
with requests.Session() as s:
soup = BeautifulSoup(s.get("<https://mail.google.com>").text, "html.parser")
for inp in soup.select("#gaia_loginform input[name]"):
if inp["name"] not in form_data:
form_data[inp["name"]] = inp["value"]
s.post(post, form_data)
html = s.get("<https://mail.google.com/mail/u/0/#inbox>").content
# Prints 'False', should print 'True'
print(my_email in s.get('<https://mail.google.com/mail/u/0/#inbox').text)>