I am trying to get bond data from this page, "https://secure.fundsupermart.com/fsm/bonds/factsheet/XS1415758991/DEGREE-7-250-03Jun2021-Corp-USD".
I inspected the page, the data can be found in Network-XHR, name is XS1415758991. The name is the bond ISIN code. I then found the link behind the name. “<a href="https://secure.fundsupermart.com/fsm/rest/bond-info/get-bond-factsheet-data/XS1415758991" rel="nofollow noreferrer">https://secure.fundsupermart.com/fsm/rest/bond-info/get-bond-factsheet-data/XS1415758991”. In the Headers, I also found "x-xsrf-token: 38ccccd8-6cae-46a9-b916-2e80e607e107".
import requests
url_bond = r'https://secure.fundsupermart.com/fsm/rest/bond-info/get-bond-factsheet-data/XS1415758991'
headers = {'Accept-Encoding': 'gzip', }
data = {"x-xsrf-token":'38ccccd8-6cae-46a9-b916-2e80e607e107'}
r = requests.post(url_bond,headers=headers, data = data)
r.text
I tried following codes, but replied "'Expected CSRF token not found. Has your session expired?'". I expect to get the data in ","bondPriceJsonHashmap"--"THREE_YEAR"