爬虫 获取JSON数据

import requests

url = "https://image.baidu.com/search/acjson?tn=resultjson_com&logid=10589435924968843904&ipn=rj&ct=201326592&is=&fp=result&queryWord=%E5%BF%AB%E4%B9%90&cl=2&lm=-1&ie=utf-8&oe=utf-8&adpicid=&st=&z=&ic=&hd=&latest=&copyright=&word=%E5%BF%AB%E4%B9%90&s=&se=&tab=&width=&height=&face=&istype=&qc=&nc=1&fr=&expermode=&force=&pn=90&rn=30&gsm=5a&1614778774882="
headers = {
    
    "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.182 Safari/537.36 Edg/88.0.705.81"}
resp = requests.get(url, headers=headers)
json_data = resp.json()
print(json_data)

猜你喜欢

转载自blog.csdn.net/qq_46620129/article/details/114337701