Answer the question
In order to leave comments, you need to log in
Lists not working in Python, what should I do?
I'm trying to parse the json of the page, but it doesn't work. I'm taking json from a site, but when I try to interact with its elements, an error is shown.
Here is the code:
import requests
url = 'https://api.pancakeswap.info/api/v2/tokens/0x246bd5d18613519deffea90c05dd0068658f076b'
response = requests.get(url)
list = response.json()
print(list[1])
Traceback (most recent call last):
File "D:\Coding\Test.py", line 8, in <module>
print(list[1])
KeyError: 1
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question