E
E
ecid12020-03-27 11:41:05
Python
ecid1, 2020-03-27 11:41:05

Can't login to the site?

I can't log in to the site. The POST request returns status code 200, but the authorization page is displayed. What could be the problem?

s = requests.Session()
url = 'https://edu.susu.ru/'
r = s.get(url)
soup = BeautifulSoup(r.text, 'html.parser')
token = soup.find('input', dict(name='logintoken'))['value']
data = {'anchor':'',
            'username': '***',
            'password': '***',
            'rememberusername':'1',
            'logintoken':token
}
r = s.post(url, data=data)
print(r.status_code)
r = s.get(url)
print(r.text)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dimonchik, 2020-03-27
@dimonchik2013

r = s.post(url, data=data)
don't forget about headers

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question