I actually wrote a code that did something similar, with help from various forums.
I'm going to put in false user and pass for obvious reasons, as the lines here are to demonstrate, I have no clue if thats the google login url.
import requests
url = 'https://www.google.com/login' #the address of the server youre logging into
username = 'foo@gmail.com' #your username
password = 'bar' #your password
requests.Session().get(url)
login_data = dict(USERNAME=username, PASSWORD=password)#Important; not all sites use USERNAME and PASSWORD, use chrome console to check
requests.Session().post(url, data=login_data)
page = requests.Session().get("https://www.google.com")#you can export the page html to a string like this, I'm supposing youre doing something else
Any variable of course can have any name, its only in the dictionary that USERNAME and PASSWORD have to be changed to something specific.