with requests.Session() as s:
    r = s.get(url)
payload['_token'] = BeautifulSoup(r.text).select_one('input[name=_token]')[
    'value']
b = s.post(url, data=payload, headers=headers, allow_redirects=1)
print(BeautifulSoup(b.text, 'lxml').select('p.username'))
Need help figuring out how to send POST login info in python