-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Scraper error "TypeError: string indices must be integers" - Yahoo decrypt fail #1291
Comments
I also have the exact same problem as you, good to know that im not alone. The yfinance ticker module seems very unstable at the moment. |
Same issue here. Traceback (most recent call last): |
Are you accessing If yes, what key are you accessing? Might be better way to get data. |
I have the same error, and it does not matter if I looping through 4 or 503 stocks..
|
Yes me too. It seems it went down hill over the last few moments. I can now only run about 1 at a time. |
Yes, I am, loop of around 450 tickers. |
Indeed, I also just encountered the same thing.
I tried adding sleep (above), but it didn't help either. The weird part, is that for a short time when I wrote the code line by line in the Python Console (pycharm) it worked, but now even in the console I get ticker_info as 'None' |
Same failure, im def not ip blocked and didn't spam. It started yesterday and today I get the same failure the whole time |
Just to +1 that I am having the same issue. Just checking 1 ticker, once a minute. |
I believe the cause of this relates to the underlying data structure this library scrapes from Yahoo Finance has changed. They introduced encryption on the ticker data before the turn of the year, which was fixed here: 8e5f098. This time around they changed the parameters on the encryption. |
In case it helps, these were the decryption params Yahoo was providing:
|
We know the decryption is failing. Please keep future comments related to debugging or fixing. |
Where Yahoo used to provide the decryption parameters, there is this new key-value. It appears to be constant.
Any ideas? |
I think
and it seems this
|
@james-stevens Please discuss the patch code in it's pull request. |
I'm not sure it makes sense to conflate the release of a critical fix with a potential efficiency improvement. 100% of the yfinance community will benefit from #1297 urgently being released. |
I think it does make sense to conflate. Why is Yahoo encrypting this data? Is it to stop scraping because of the high server load? Then it's in our benefit to reduce load of Plus this will not delay much, most groundwork was done weeks-months ago. EDIT: Actually, makes more sense to release the |
I would appreciate an expedited roll out. I use Yfinance pretty extensively and all my code is now defunct. Sent from my iPhoneOn Jan 14, 2023, at 11:52 AM, ValueRaider ***@***.***> wrote:
I think it does make sense to conflate. Why is Yahoo encrypting this data? Is it to stop scraping because of the high server load? Then it's in our benefit to reduce load of yfinance. What will Yahoo do next?
Plus this will not delay much, most groundwork was done weeks-months ago.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: ***@***.***>
|
PIP release out |
The google collab notebook I'm using has this in it and its still failing !pip3 install yfinance Would you expect that to be working now? |
Thank you very much - your time and expertise is appreciated by the community. I uninstalled and reinstalled latest...everything working perfectly! Again - many thanks! |
Got it. It was just defaulting to the old version. This works: !pip3 install yfinance==0.2.4 Thank you very much for the quick turn around. |
Is there any reason why I would be getting a 'ModuleNotFoundError: No module named 'multitasking'" error? Multitasking, as well as yfinance 0.2.4 are both installed in my environment. |
Hi all! Thank you very much for the fix, I'll try it right away 😄 I have one question related to this that is bothering me and maybe you could help me understand... isn't it pointless that Yahoo encrypts this AND shares the key to decrypt it? I mean, If I encrypt something it's because I want to secure the data and then I would share the key to whomever should be allowed to decrypt it, so, why encrypt and give the key. To me sound wrong, but probably I am missing something here 😅 |
Also started facing the same issue, any solution here or do need to change the code structure? |
Double check you upgraded to the most recent version 0.2.4. |
Naah, using yfinance==0.1.93 |
Download latest PIP release to get the fix. That's how bug fixes work. |
still not working |
I just upgraded the pip and yfinance, everything is working fine now. |
Upgraded to yfinance==0.2.4 and it works fine now 👍 ! |
Thx for the effort guys and girls. very much appreciated from here ! |
Updates
2023 January 13
By the time of posting the issue (2023 January 12), the issue only occured sometimes. The library is now (2023 January 13) completely broken and I am unable to retrieve any stock informatio
2023 January 14
Fix has been merged to the branch
dev
Info about your system:
yfinance version: 0.2.3
Operating system: macOS Monteray 12.0.1
Snippet that can recreate the error
Error
Message:
TypeError: string indices must be integers
It seems to be a problem where the scraper is not scraping the correct information, leading to a crash.
Traceback:
Frequency
The error occurs in no apparent pattern. Every time it occurs, it seem to persist for some range of time before it recovers back to normal.
n.
The text was updated successfully, but these errors were encountered: