dimanche 8 mars 2020

Getting a json string off a website with python

There is a link with a json string which I can't seem to extract inside a python dictionary.

I tried with the requests library and with beautifullsoup the link with the website is https://www.bloomberg.com/markets2/api/history/AAPL%3AUS/PX_LAST?timeframe=1_MONTH&period=daily&volumePeriod=daily

for example link = "https://www.bloomberg.com/markets2/api/history/AAPL%3AUS/PX_LAST?timeframe=1_MONTH&period=daily&volumePeriod=daily"

import requests
res = requests.get(link)
res.content  
'or
res.read

only gets me a long html tekst with anything but the tekst on that website.

How do i scrape of this specific websites string?

Gr Stephan




Aucun commentaire:

Enregistrer un commentaire