import json
import requests
def login():
session = requests.session()
header = {
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_5)AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.102 Safari/537.36'
}
login_info = {
'ck': "",
'remember': "true",
'name': "18858662319",
'password': "luomy1010"
}
re = session.post('https://accounts.douban.com/j/mobile/login/basic', data=login_info, headers=header)
re_info = json.loads(re.text)
if re_info['status'] == 'failed':
print('登陆失败')
else:
print('登陆成功')
if __name__ == '__main__':
login()