Example: automatic login drawer new hot list

response.cookies is the object again get_dict () returns a dictionary

Once logged on to have a cookie access

get and post are cookies

 

import requests
post_dict = {
    "phone": '8615131255089',
    'password': 'woshiniba',
    'oneMonth': 1
}
response = requests.post(
    url="http://dig.chouti.com/login",
    data=post_dict
)
print(response.text)
cookie_dict = response.cookies.get_dict()
print(cookie_dict)

response = requests.get(
    url='http://dig.chouti.com/profile',
    cookies=cookie_dict
)
print(response.text)
s2.py

 

Guess you like

Origin www.cnblogs.com/jintian/p/11391995.html