Parsing HTTP Response in Python

后端 未结 5 711
夕颜
夕颜 2020-12-13 09:08

I want to manipulate the information at THIS url. I can successfully open it and read its contents. But what I really want to do is throw out all the stuff I don\'t want,

5条回答
  •  天涯浪人
    2020-12-13 09:53

    You can also use python's requests library instead.

    import requests
    
    url = 'http://www.quandl.com/api/v1/datasets/FRED/GDP.json'    
    response = requests.get(url)    
    dict = response.json()
    

    Now you can manipulate the "dict" like a python dictionary.

提交回复
热议问题