[英]How to parse information from GitHub API JSON response?
Something like the below:类似于以下内容:
Do HTTP GET to the URL对 URL 执行 HTTP GET
If staus code is OK - turn the data into list of dicts and extract the info from each dict如果状态代码正常 - 将数据转换为字典列表并从每个字典中提取信息
import requests r = requests.get('https://api.github.com/users/ariv797/repos') if r.status_code == 200: data = r.json() desc_lst = [e['description'] for e in data] print(desc_lst)
output输出
['Python script for bookmyshow', 'Fidellity is a voice assistant app built using fluttter', 'Flutter package for Open Weather API integration', 'Hogwarts (Harry Potter) open sandbox game made in Unity', 'Datasets of SpaceX rockets, launches, satellites, cores, ships and more.', 'Simple extension to remove audio ads on Spotify web player', 'Just scrapes the latest version of popular programming languages']
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.