import json def fetch_data(url): req = request.Request(url) with request.urlopen(req) as f: if not f.status == 200: raise ValueError('请求失败') return json.loads(f.read().decode('utf-8'))
Sign in to make a reply
EddieLau_