class SessionGoogle:

    def __init__(self, url_login, url_auth, login, pwd):
        self.ses = requests.session()
login_html = self.ses.get(url_login)
soup_login = BeautifulSoup(login_html.content).find('form').find_all('input')
my_dict = {}
for u in soup_login:
    if u.has_attr('value'):
        my_dict[u['name']] = u['value']
my_dict['Email'] = login
my_dict['Passwd'] = pwd
self.ses.post(url_auth, data=my_dict)

def get(self, URL):
    return self.ses.get(URL).text
Logging in to google using python?