Cookie直接写到headers里:header = {'content-type': 'application/json; charset=utf-8',
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko',
'Cookie': '_T_WM: 16302431710; WEIBOCN_FROM=1110006030; ALF: 1595143722; SUB: _2A25z6Bl7DeRhGeBN7FcS8CbMyD-IHXVREqczrDV6PUNbktANLVH9kW1NRCJy5XgYpfllO6KntJ0z9VlG3WS8Dk5B;SUBP: 0033WrSXqPxfM725Ws9jqgMF55529P9D9Wh-s9cYGJn3yMhQAD89z7Ve5JpX5KzhUgL.Foq0S0-0ehn7e0e2dJLoIpjLxK-LBo5LBo.LxKqL1-eL1h.LxKqLBozLB.zt; SUHB: 0auQfAd6YqJgiP; SSOLoginState=1592205572; MLOGIN=1; M_WEIBOCN_PARAMS: luicode%3D10000011%26lfid%3D102803%26fid%3D231522type%253D1%2526t%253D10%2526q%253D%2523%25E5%25A4%2596%25E4%25BA%25A4%25E9%2583%25A8%25E5%259B%259E%25E5%25BA%2594%25E4%25B8%25AD%25E5%258D%25B0%25E8%25BE%25B9%25E5%25A2%2583%25E5%2586%25B2%25E7%25AA%2581%2523%26uicode%3D10000011; XSRF-TOKEN: 49dc89'
}
html = requests.get(url, headers=header)
|