demo_requests_response_json.py:
import requests url = 'https://www.begtut.com/python/demopage.js' x = requests.get(url) print(x.json())
➜ begtut>python demo_requests_response_json.py
{'firstname': 'John', 'lastname': 'Doe'}