Python Forum
Issues parsing the response from a request
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Issues parsing the response from a request
#3
(May-11-2019, 06:05 AM)buran Wrote:
>>> my_json = {u'data': [{u'count': 43.0, u'buttonColor': u'Yellow'}]}
>>> my_json['data'][0]['count']
43.0
>>> 
note that if there are more than one item in the data list you will need to iterate over them

I seriously can not believe I missed this :-( Thank you!
Reply


Messages In This Thread
RE: Issues parsing the response from a request - by garnold - May-14-2019, 12:02 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  request.get to read large response pythonlearner1 7 3,436 Apr-05-2022, 08:21 PM
Last Post: pythonlearner1
  how can I correct the Bad Request error on my curl request tomtom 8 5,258 Oct-03-2021, 06:32 AM
Last Post: tomtom
  Unable to convert request response. johnboy1974 4 3,237 Apr-05-2021, 10:10 AM
Last Post: snippsat
  Empty response to request causing .json() to error t4keheart 1 10,291 Jun-26-2020, 08:35 PM
Last Post: bowlofred
  ImportError: cannot import name 'Request' from 'request' abhishek81py 1 4,015 Jun-18-2020, 08:07 AM
Last Post: buran
  Parsing Soap XML response grootkarzijn 7 15,829 Jun-14-2019, 01:30 AM
Last Post: snippsat

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020