0

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  

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

How do I scrape of this specific websites string?

zvi
  • 3,677
  • 2
  • 30
  • 48

1 Answers1

0

Please check the output of resp.url .

enter image description here

You are trying to progmatically access content from a website that is protected against those behaviors.

  1. an access key can help you.
  2. you can trick the detection in various ways which could be semi legal .. but requests probably cannot get you there.
InLaw
  • 2,537
  • 2
  • 21
  • 33