-
Notifications
You must be signed in to change notification settings - Fork 51
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
IndexError: list index out of range running sample code "To get XBRL data" #20
Comments
There's no Also, thanks for trying to donate, and letting me know. I fixed the link now. If it still doesn't work, let me know too :) |
@joeyism Many of the examples still give me this error:
|
@joeyism I have also run into this error intermittently. Any pointers on how to debug this? |
@joeyism Hi Joey, I also noticed this error when I tried to use edgar module. Luckily, I was also able to pinpoint the reason for this due to one of my other personal project. this can be easily solved by adding headers in the request.get part of the code. I've manually added below this in all your edgar module files, and my issue was resolved. Step 1: Add this at beginning of module files (company.py , edgar.py, etc.): Step 2: in the module files, search for requests.get. And in all the requests.get syntax, add headers=hdr after the url. my issue was resolved after this. |
related to #29 And no, those are not the correct headers to use. |
You might be correct. I'm not good with programming, i dont have any computer science or coding background... just a newbie here. I tried this headers based on some other website, and it worked for me. So I mentioned it here. |
Hello Joey!
I want to say thanks so much for working on this project, it is exactly what I hoped to find.
I have been working with the package and sample code some and am getting an index error running your sample code from the section "To get XBRL data".
Specifically, "results" is a list with no elements after running the following line:
results = company.get_data_files_from_10K("EX-101.INS", isxml=True)
The error occurs during execution of the next line:
xbrl = XBRL(results[0])
I originally tried this in a Jupyter notebook, but also tried in an interactive interpreter session to make sure it wasn't just related to the environment.
I would appreciate it if you could provide some assistance and let me know if this problem is a known issue or something I am doing wrong, please?
I specifically would like to collect "facts" from the 10-K reports like number of common shares outstanding, for instance.
Thanks, sincerely
P.S. - I followed the BuyMeACoffee.com link with the intent of providing support, and found you don't have a support button on your page...
The text was updated successfully, but these errors were encountered: