'Web Login Authentication with Python, Requests, Session

I am attempting to do session login that requires csrf token.

import requests
from requests import Session
login = ''
profile = ''

r = requests.get(login)
payload = {
    'login': '',
    'pass': '',
    'logclick': '',
    'uber_csrf_key': '',
    'uber_csrf_token': '',
    }

Session.post(url = login, cookies = r.cookies, data = payload)
test = Session.get(profile)
print(test)

This returns this error message:

TypeError: Session.post() missing 1 required positional argument: 'self'

and I am having a difficult time finding manual for this library. Is there a better way to do this?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source