import requests
import json
url = "https://api.bilibili.com/x/web-interface/view?aid=61908575&cid=107641262"
r = requests.get(url)
content = json.loads(r.text) #解析返回来的json
# print(content)
data = content.get("data") #或者 content["data"]
stat_ = data.get("stat")
# print(data)
# print(stat)
datas = {}
datas["aid"] = data["aid"]
datas["title"] = data["title"]
datas["ownername"] = data["owner"]["name"]
datas["view"] = stat_["view"]
datas["favorite"] = stat_["favorite"]
datas["coin"] = stat_["coin"]
datas["share"] = stat_["share"]
datas["like"] = stat_["like"]
print(datas)
#
# datas["data" : data]
网友评论