joeyism / py-edgar

A small library to access files from SEC's edgar
GNU General Public License v3.0
221 stars 52 forks source link

Issue with parsing 10K filings #23

Open kostadtk opened 3 years ago

kostadtk commented 3 years ago

I am using edgar 5.4.1 to get 10K filings from the SEC database but I cannot parse the html elements and see the actual text content of the documents.
It seems to be the proper way for the 5.4.1 version but it raises an attribute error.

import edgar
company = edgar.Company("Facebook Inc", "0001326801")
tree = company.get_all_filings(filing_type="10-K")
docs = edgar.Company.get_documents(tree=tree, no_of_documents=5, as_documents=True)
sample_text = edgar.TXTML.parse_full_10K(docs[3].element) 
sample_text

Capture

I tried another way too, as below, but I think it would work only in a previous version.

import edgar
company = edgar.Company("Facebook Inc", "0001326801")
tree = company.get_all_filings(filing_type="10-K")
docs = edgar.Company.get_documents(tree=tree, no_of_documents=5)
docs[3].element.text_content()

Capture1

Is there sth I don't get? What is the issue here?

Thanks, in advance!