我第一次尝试使用api,并且我需要使用被调用的数据。当我运行我的脚本时,我得到了一个<Response [200]>
,所以我的代码是成功的,但是我如何查看和使用被调用的信息呢?谢谢!
发布于 2021-10-14 03:03:54
如果您使用的是requests
。
response = requests.get("some url")
response.status_code # get the status code
json_response = response.json() # convert response to json
print(json_response) # you can see dictionary-like structure
print(json_response["arbitrary"]) # you can access data just like normal dictionary
https://stackoverflow.com/questions/69564568
复制相似问题