Friday, 28 June 2019

How to login using requests in Python?

I would like to get data from https://creis.fang.com/.

However, I need to login the page first.

There are 4 values I need to fill in.

I tried to use requests but failed.

Here is my code:

import requests
url = 'https://creis.fang.com/'
s = requests.Session()
data ={'cnname': 'myname', 'cnotp':'abc', 'cntempcode':'123', 'cnproducttitle':'企业版'}
r = s.post(url=url, data=data)

Can you help me?

Thanks.

enter image description here

enter image description here enter image description here enter image description here



from How to login using requests in Python?

No comments:

Post a Comment