麻烦老师帮我看下这个问题
来源:3-3 requests的使用get请求
cloudonthesun
2021-06-27
老师,
在代码里我加上
verify=False
反而会报出warning提示
代码如下:
************************************************************
'''
requests的基础使用-post请求
'''
import requests
'''
requests库发送get参数---fiddler抓包,CSDN查看我的粉丝
'''
get_url1 = 'https://blog.csdn.net/community/home-api/v1/get-fans-list'
data_get = {
'page' : 1,
'size' : 20,
'noMore' : False,
'blogUsername' : 'xun_zhao_t521'
}
header = {
'Host': 'blog.csdn.net',
'Connection': 'keep-alive',
'sec-ch-ua': '" Not;A Brand";v="99", "Google Chrome";v="91", "Chromium";v="91"',
'Accept': 'application/json, text/plain, */*',
'sec-ch-ua-mobile': '?0',
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.106 Safari/537.36',
'X-Tingyun-Id': 'C0UKgY0m8NI;r=713972543',
'Sec-Fetch-Site': 'same-origin',
'Sec-Fetch-Mode': 'cors',
'Sec-Fetch-Dest': 'empty',
'Referer': 'https://blog.csdn.net/xun_zhao_t521?type=sub&subType=fans&spm=1008.2221.3001.5347',
'Accept-Encoding': 'gzip, deflate, br',
'Accept-Language': 'zh-CN,zh;q=0.9',
'Cookie': 'uuid_tt_dd=10_19335407230-1578116406119-403198; UN=xun_zhao_t521; Hm_ct_6bcd52f51e9b3dce32bec4a3997715ac=6525*1*10_19335407230-1578116406119-403198!5744*1*xun_zhao_t521; p_uid=U010000; __gads=ID=87281ad60b78bded-2253448b88c70011:T=1619180162:RT=1619180162:S=ALNI_MYKTEuIeUFdtHJjGkv99a5cImWo3g; c_segment=14; dc_sid=61eb164b4629636fdddfddcaefcba024; c_first_ref=www.baidu.com; firstDie=1; Hm_lvt_e5ef47b9f471504959267fd614d579cd=1623586436,1624323717,1624675419; SESSION=a8a31221-8ef9-4c7b-b084-8ef5ee2b87cf; Hm_lpvt_e5ef47b9f471504959267fd614d579cd=1624693942; ssxmod_itna=eq0xgDuD07GQ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451; UserNick=%E6%89%A7%E5%AD%90%E6%89%8B+%E5%90%B9%E6%95%A3%E8%8B%8D%E8%8C%AB%E8%8C%AB%E7%83%9F%E6%B3%A2; AU=FC9; BT=1624694015917; Hm_up_6bcd52f51e9b3dce32bec4a3997715ac=%7B%22islogin%22%3A%7B%22value%22%3A%221%22%2C%22scope%22%3A1%7D%2C%22isonline%22%3A%7B%22value%22%3A%221%22%2C%22scope%22%3A1%7D%2C%22isvip%22%3A%7B%22value%22%3A%220%22%2C%22scope%22%3A1%7D%2C%22uid_%22%3A%7B%22value%22%3A%22xun_zhao_t521%22%2C%22scope%22%3A1%7D%7D; dc_session_id=10_1624711700473.526426; c_first_page=https%3A//blog.csdn.net/qq_2300688967/article/details/79028304; announcement-new=%7B%22isLogin%22%3Atrue%2C%22announcementUrl%22%3A%22https%3A%2F%2Fblog.csdn.net%2Fblogdevteam%2Farticle%2Fdetails%2F112280974%3Futm_source%3Dgonggao_0107%22%2C%22announcementCount%22%3A0%2C%22announcementExpire%22%3A3600000%7D; Hm_lvt_6bcd52f51e9b3dce32bec4a3997715ac=1624708305,1624708455,1624708568,1624712066; log_Id_view=996; Hm_lpvt_6bcd52f51e9b3dce32bec4a3997715ac=1624713929; log_Id_click=174; c_pref=https%3A//mp.csdn.net/mp_blog/manage/article%3Fspm%3D1011.2124.3001.5298; c_ref=https%3A//mall.csdn.net/myorder%3Fspm%3D1011.2124.3001.5137; c_page_id=default; dc_tos=qvb9bo; log_Id_pv=417'
}
res2 = requests.get(get_url1,data_get,headers=header,verify=False).text
print(res2)
************************************************************
运行输出如下:
我尝试把verify=False去掉后反而不报错了
这是为什么呢
1回答
-
Mushishi
2024-12-31
浸膏不是报错。https会有警告
00
相似问题