Skip to content
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

AttributeError: 'NoneType' object has no attribute 'group' #1479

Closed
cybernkotb opened this issue Apr 4, 2023 · 3 comments
Closed

AttributeError: 'NoneType' object has no attribute 'group' #1479

cybernkotb opened this issue Apr 4, 2023 · 3 comments

Comments

@cybernkotb
Copy link

IMPORTANT

If you want help, you got to read this first, follow the instructions.

Are you up-to-date? Y

Upgrade to the latest version and confirm the issue/bug is still there.

$ pip install yfinance --upgrade --no-cache-dir

Confirm by running:

import yfinance as yf ; print(yf.__version__) -- 0.2.12

and comparing against PIP.

Does Yahoo actually have the data? Yes

Are you spelling ticker exactly same as Yahoo? Yes

Then visit finance.yahoo.com and confirm they have the data you want. Maybe your ticker was delisted, or your expectations of yfinance are wrong.

Are you spamming Yahoo?

Yahoo Finance free service has rate-limiting depending on request type - roughly 60/minute for prices, 10/minute for info. Once limit hit, Yahoo can delay, block, or return bad data. Not a yfinance bug.

Still think it's a bug?

Delete this default message (all of it) and submit your bug report here, providing the following as best you can:

  • Simple code that reproduces your problem, that we can copy-paste-run :
  • import time
    import yfinance as yf

ticker = "AAPL"
time.sleep(1) # Add a delay before fetching the data
stock = yf.Ticker(ticker)

time.sleep(1) # Add a delay before accessing the financials
income_statement = stock.financials

print(f"Income Statement for {ticker}:")
print(income_statement)

  • Exception message with full traceback, or proof yfinance returning bad data
  • re_data = json.loads(re.search("root.App.main\s+=\s+(\{.*\})", re_script).group(1))
    

AttributeError: 'NoneType' object has no attribute 'group'

  • yfinance version and Python version : Python 3.10.10 & 0.2.12
  • Operating system type - windows 11
@ValueRaider ValueRaider closed this as not planned Won't fix, can't repro, duplicate, stale Apr 4, 2023
@ValueRaider ValueRaider reopened this Apr 4, 2023
@ValueRaider
Copy link
Collaborator

0.2.12

Old version

@ValueRaider ValueRaider closed this as not planned Won't fix, can't repro, duplicate, stale Apr 4, 2023
@theorician
Copy link

@ValueRaider Reproducible in 0.2.14. Exactly the same error.

@ValueRaider
Copy link
Collaborator

ValueRaider commented Apr 4, 2023

@cybernkotb Provide the FULL traceback. Also that error shouldn't happen, instead you should see this #1407

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants