atreadw1492 / yahoo_fin

Scrape stock price history from new (Spring 2017) Yahoo Finance layout
MIT License
285 stars 125 forks source link

requests_html error (not installed) #115

Closed arline closed 3 months ago

arline commented 3 months ago

I'm writing a simple code to test yahoo_fin. The error claims requests_html is not installed but as you can see below, it is. I've reinstalled python and all its libraries and still get this error. I find it strange that the error message claims requests_html but the library is requests-html. I tried installing with _ but it says "Requirement already satisfied". I tried running the script regardless of this warning message but below code does not bring any data. I'm using the command prompt and IDLE, the code I write in notepad++

code: import yahoo_fin.stock_info as yf ticker = 'nflx' balance_sheet = yf.stock_info.get_balance_sheet(ticker) print(balance_sheet)

error requests-html

Anyone know how I could fix it? thank you!

arline commented 3 months ago

Issue resolved in 2 steps

1) import from requests_html import HTMLSession #line added from yahoo_fin import stock_info as yf

2) "pip install lxml_html_clean"