作者te1e1 (te1e1)
看板Python
标题[问题] 新手询问web client的问题
时间Thu Feb 11 01:05:24 2021
抱歉,我对於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後面的内容,我该怎麽做呢?
拜托解惑了
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 1.169.24.10 (台湾)
※ 文章网址: https://webptt.com/cn.aspx?n=bbs/Python/M.1612976727.A.142.html
1F:→ zerof: json.loads 02/11 01:22