How do I parse a JSON response from Python Requests?

后端 未结 7 1253
悲&欢浪女
悲&欢浪女 2021-02-19 00:09

I am trying to parse a response.text that I get when I make a request using the Python Requests library. For example:

def check_user(s         


        
相关标签:
7条回答
  • 2021-02-19 00:49

    I found another solution. It is not necessary to use json module. You can create a dict using dict = eval(whatever) and return, in example, dict["result"]. I think it is more elegant. However, the other solutions also work and are correct

    0 讨论(0)
提交回复
热议问题