I am currently struggling with this page of Yahoo Finance : https://sg.finance.yahoo.com/quote/1B0.SI/history?period1=1426780800&period2=1489939200&interval=div%7Csplit&filter=split&frequency=1mo
I would need to get the date and ratio of the stock split, but I dove into a json file in which I do not see any of these information!
I'm using the script mentionned here How to understand this raw HTML of Yahoo! Finance when retrieving data using Python?
from bs4 import BeautifulSoup
from pprint import pprint as pp
import re
import json
import requests
url='https://sg.finance.yahoo.com/quote/1B0.SI/history?period1=1426780800&period2=1489939200&interval=div%7Csplit&filter=split&frequency=1mo'
soup = BeautifulSoup(requests.get(url).content)
script = soup.find("script",text=re.compile("root.App.main")).text
data = json.loads(re.search("root.App.main\s+=\s+(\{.*\})", script).group(1))
stores = data["context"]["dispatcher"]["stores"]
pp(stores)
Please let me know if your have the idea where I can find it.
Thanks!