import requests
import pandas as pd
url = "https://www.nseindia.com/api/equity-stockIndices?index=NIFTY%2050"
headers = { "User-Agent" : "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36",
"Accept-Language" : "en-US;q=0.5",
"Accept-Encoding" : "gzip, deflate"}
js = requests.get(url, headers=headers).json()
r = js['data']
print(r)
this code works fine in pycharm but not working in colab ... please help how to get rid of this
i just need to get this json data in Colab