When I asked around, I heard that you need to put json instead of string to index even if it's not an integer.
Is the variable match not json? ㅠ<
Json from the web.
response = requests.get( url, headers=headers)
print(response)
match = response.json()
print(match)
print(match["matches"]["matches"]["characterName"])
Try this.
# Convert the response to a string and use json.loads()
# I don't know if the type (response) is str, json, or response object...
match = json.loads(str(response))
# It'll probably come out.
print(match["matches"]["matches"]["characterName"])
© 2024 OneMinuteCode. All rights reserved.