unable to download CSV with selenium.

I am trying to download CSV data using selenium and python, but not able to do so, also nse website is not returning response for nse option chain website “https://www.nseindia.com/option-chain”. Is there any other work around. I tried google and found url: https://www.nseindia.com/api/option-chain-indices?symbol=NIFTY
Wondering where did this url come from. TIA.
Note -I am new with coding and want to make my data analysis automated…