atreadw1492 / yahoo_fin

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

stock_info stop working even with the recent fix #63

Open bp9112001 opened 3 years ago

bp9112001 commented 3 years ago

Just updated to the current version for yahoo_fin. Here is the traceback of the error. Thanks

from yahoo_fin import stock_info as si

%5EGSPC failed Exception in user code:

Traceback (most recent call last): File "yahoo.py", line 11, in data = si.get_data(sym)

\local-packages\Python38\site-packages\yahoo_fin\stock_info.py", line 78, in get_data raise AssertionError(resp.json()) \local-packages\Python38\site-packages\requests\models.py", line 898, in json return complexjson.loads(self.text, **kwargs) File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.2800.0_x64qbz5n2kfra8p0\lib\json\init.py", line 357, in loads return _default_decoder.decode(s) File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.2800.0_x64qbz5n2kfra8p0\lib\json\decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.2800.0_x64__qbz5n2kfra8p0\lib\json\decoder.py", line 355, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Jozefiel commented 3 years ago

Same problem, but pip install yahoo-fin==0.8.9.1 solved this issue

bp9112001 commented 3 years ago

not for me, in windows 10

same problem after pip to 0.8.9.1

python -V Python 3.9.1

pip show yahoo_fin Name: yahoo-fin Version: 0.8.9.1 Summary: Download historical stock prices (daily / weekly / monthly), realtime-prices, fundamentals data, income statements, cash flows, analyst info, current cryptocurrency prices, option chains, earnings history, and more with yahoo_fin. Home-page: http://theautomatic.net/yahoo_fin-documentation/ Author: Andrew Treadway Author-email: opensourcecoder11@gmail.com License: MIT

bp9112001 commented 3 years ago

correction. Actually, for some other issues, I always run python as python3 myscript.py

It stopped working recently even after I set to 0.8.9.1

However, if I run script directly as

script.py

It is working now. Thanks @Jozefiel

parkheedo commented 3 years ago

I am having the same issue... I am using Pi. Does anyone know how to fix it with Linux?

atreadw1492 commented 3 years ago

I am having the same issue... I am using Pi. Does anyone know how to fix it with Linux?

Are you getting the same "JSONDecodeError" error using 0.8.9.1?

daksh931 commented 1 year ago

Same issue after changing to v6 and even installing older versions too getiing Json error then