dimanche 13 septembre 2020

Can't login to a website using python requests

i want to login to a website using python requests, here is my script:

session = requests.Session()

loginData = {
    'email': 'account gmail',
    'passwd': 'account password',
    'back': 'my-account',
    "SubmitLogin": ""
}


r = session.post('login request', data=loginData)
print(r.status_code)
rep = session.get('my account request')
print(rep.headers)

but it doesnt work, here is the header i get

200
{'Date': 'Sun, 13 Sep 2020 13:22:01 GMT', 'Server': 'Apache', 'P3P': 'CP="IDC DSP COR CURa ADMa OUR IND PHY ONL COM STA"', 'Powered-By': 'PrestaShop', 'Vary': 
'Accept-Encoding', 'Content-Encoding': 'gzip', 'Content-Length': '10177', 'Connection': 'close', 'Content-Type': 'text/html; charset=utf-8'}



Aucun commentaire:

Enregistrer un commentaire