|
import requests
#字符串Cookie转字典Cookie
def cookie_to_dic(cookie):
cookie_dic = {}
for i in cookie.split('; '):
cookie_dic[i.split('=')[0]] = i.split('=')[1]
return cookie_dic
#Cookie
Cookie = cookie_to_dic(
"langx=zh-cn; langcode=zh-cn; sid=538b24066053e1a0afbce4326c7fc28; PHPSESSID=eal1h50lhu62mtaf6; aglvl=538b24066053e18cbce4326c7fcd8; aghid=30383820202; lang=zh-cn")
#协议头
Header_Selfdefine = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Firefox/68.0',
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3',
'Accept-Language': 'zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2',
'Accept-Encoding': 'gzip, deflate, br'
}
#post参数
request_post_data = {
"current": "RMB",
"MemNameSel": "all",
"mem_name": "",
}
Url = "http://www.xxx.com/xxx"
Requests_ID = requests.post(Url, headers=Header_Selfdefine, cookies=Cookie, data=request_post_data)
Requests_Html = str(Requests_ID.content, encoding="utf-8") |
|