url = http://comment5.news.sina.com.cn/page/info?version=1&format=json&channel=gn&newsid=comos-fyqwiqk6940531&group=undefined&compress=0&ie=utf-8&oe=utf-8&page=1&page_size=3&t_size=3&h_size=3&thread=1&callback=jsonp_1516944623284&_=1516944623284這個網(wǎng)頁的json內(nèi)容是這樣的。我用python的res = requests.get(url)接下來,怎么操作能 打印出 上圖紅圈中的‘23’數(shù)字呢?
1 回答
已采納

產(chǎn)品經(jīng)理不是經(jīng)理
TA貢獻481條經(jīng)驗 獲得超143個贊
import?json res?=?requests.get(url) jsonStr=res.text[res.text.index('{'):res.text.rindex('})'+1] jo?=?json.loads(jsonStr) print(jo['result']['count']['total'])
添加回答
舉報
0/150
提交
取消