-
Notifications
You must be signed in to change notification settings - Fork 681
Unable to fetch stock data from yahoo! #995
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Same issue |
Problem seem to be caused by this code snippet (at line 149 in yahoo/daily.py): if pattern is not found, re.search() returns None while the programmer was expecting a KeyError exception. Nobody fixed the problem in the last 8 months. |
code
result
best regards |
It seems the data pattern on the Yahoo Finance site has changed, and the code in the So I tried using the yfinance library instead, and it worked: import yfinance as yf
import datetime as dt
start = dt.datetime(2000, 1, 1)
end = dt.datetime(2024, 12, 31)
# Download historical data
df = yf.download("TSLA", start, end)
print(df.head()) |
Run the following code to reproduce the issue:
You will get the following exception:
The text was updated successfully, but these errors were encountered: