[問題] 新手詢問web client的問題

作者: te1e1 (te1e1)   2021-02-11 01:05:24
抱歉,我對於python是新手。最近要寫一個http client的小程式,我透過httpbin.org
中測試get body的內容。現在是已經有抓到body內容,如下:
{
"args": {},
"headers": {
"Accept": "application/json",
"Accept-Encoding": "gzip, deflate",
"Accept-Language": "zh-TW,zh;q=0.9,en-US;q=0.8,en;q=0.7,zh-CN;q=0.6",
"Host": "httpbin.org",
"Referer": "http://httpbin.org/",
"User-Agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64)
AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36",
"X-Amzn-Trace-Id": "Root=1-60240a3d-06dd5c06287e4acd1cdcae38"
},
"origin": "1.169.24.10",
"url": "http://httpbin.org/get"
}
我想請問,如果我想要只抓取Accept後面的內容,我該怎麼做呢?
拜託解惑了
作者: zerof (貓橘毛發呆雕像)   2021-02-11 01:22:00
json.loads

Links booklink

Contact Us: admin [ a t ] ucptt.com