Put call ratio index import from yahoo finance

hi everyone, 

i would like to create and index based on the put call parity options on a specified stock. 

How can i read directly from this http url 

the table, without downloading the data and after import? 

I need my jupiteer notebook read automatically from yahoo finance 

the put and call price and each data. 

this is the link.

really thanks for your help. 



Tesla, Inc. (TSLA) Options Chain - Yahoo Finance



 

Hi Irene,



You can get the option chain data from Yahoo Finance using the yfinance package. You can go through this Jupyter notebook to learn more about the same. 



Hope this helps!



Thanks,

Akshay

thanks, but for example for put option there is not the tickers, so i have problem with the import. 

thanks for the next answer. 



 

Hi Irene,



You can extract the tickers from the contract name. For example, if the contract name is "MSFT210604P00135000" you can extract the ticker name "MSFT" from the same. 



Hope this helps!



Thanks,

Akshay