How to solve the problem of no output after calling the api with Python?
巴扎黑
巴扎黑 2017-06-12 09:19:53
0
2
699

After calling the api with Python, no json file appears. Instead, the following situation occurs, see screenshot.

from pprint import pprint
import requests
import json

token = 'EF8EA-070DF-BBEBE-EFDE4'
headers={"DAIWAN-API-TOKEN":token}
page=requests.get("http://lolapi.games-cube.com/GetChampionDetail?champion_id=1",headers = headers)
pprint(page.json)
巴扎黑
巴扎黑

reply all(2)
扔个三星炸死你
pprint(page.json())
三叔

See why after using requests.get URL, the .text response content is in the form of a dictionary, but type it is str

page.json()

or

eval(page.text)
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!