joeyism / py-edgar

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

Retrieving latest 10-K file does not give the actual filing #10

Closed victor4shen closed 4 years ago

victor4shen commented 4 years ago

I'm running this code to get the most recent 10-K file for 1st Source Corp:

company = edgar.Company("1ST SOURCE CORP", "34782") a = company.getAllFilings(filingType = "10-K",noOfEntries = 1) filings = edgar.getDocuments(tree = a, noOfDocuments = 1) soup = BeautifulSoup(filings,'html5lib') text = soup.get_text(strip = True) print(text)

The output does not give me the actual filing, but gives me this:

    This application relies heavily on JavaScript, you
    will need to allow JavaScript to use this application.Inline Viewer

                    Menu
                    Menu

                    Information
                    Save XBRL Instance
                    Save
                        XBRL Zip File
                    Open
                        as HTML
                    Settings
                    Help

                    Sections
                    Sections

                                Additional
                                    Search Options

                                    Include Fact Name

                                    Include Fact Content

                                    Include Labels

                                    Include Definitions

                                    Include Dimensions

                                Reference Options

                                        Include Topic

                                        Include Sub-Topic

                                        Include Paragraph

                                        Include Publisher

                                        Include Section

                                    Match Case

                            Clear Search

                            Submit Search

                    Data
                    Data

                            All

                                Amounts Only

                                Text Only

                                Calculations Only

                                Negatives Only

                                Additional Items Only

                    Tags
                    Tags

                            All

                                Standard Only

                                Custom Only

                    More Filters
                    More Filters

                        Selecting any of the below will take a few moments.

                                        Periods

                                        Measures

                                        Axis

                                        Members

                                        Scale

                                        Balance
                                        2

                                            Debit

                                            Credit

                    Reset All Filters

                    Links

                    Facts

            Loading Inline Form.

            Tagged Sections

                        Search in All.

                        Search in Internal Sections
                            Only.

                        Search in External Sections
                            Only.

                    Clear Sections
                        Search

                    Submit Sections
                        Search

                            Document Entity Information

                            Financial Statements

                            Notes to the Financials

                            RR Summaries

            Help

                            Getting Started

                    The Inline XBRL Viewer allows a user to quickly
                        and easily review details of the tagged information in an Inline
                        document by automatically placing a top and bottom highlight
                        border around each tagged numeric fact and left and right border
                        for each block tagged fact. Hovering over a tagged fact will
                        highlight (shade) all content related to the tagged fact, and
                        clicking on a tagged fact will reveal its tagging details in the
                        Fact Review Window. Search and filter options are also provided
                        to easily refine and identify specific types of tagged
                        information.

                            Fact Review Window

                    The Fact Review Window shows the tagging
                        details for the currently selected fact, which is highlighted
                        with a solid blue background. There are four categories of fact
                        detail which can be viewed; an “N/A” value indicates there is no
                        available information for the item within the given category:

                        Attributes - All primary information (as applicable)
                            describing the tagged fact including period, sign, decimals,
                            dimensional detail (axes and members), scale, measure, data type
                            and footnotes
                        Labels - Detailed documentation (definition) for the tag
                            used, and other labels
                        References - Authoritative reference information (as
                            applicable) for the selected tag
                        Calculation - Balance and calculation hierarchy details
                            (numeric items only)

                            Search

                    The Search box can be used to find tagged facts
                        matching entered keywords. By default, tag name, tag labels, and
                        tagged content are included in Search. To search tagged
                        information, enter a keyword and select the magnifying glass icon
                        to return matching results. Tagged facts matching the search
                        criteria are shown with a yellow-colored (default) shading, while
                        Tagged Sections are reduced to just those that included the
                        entered search keywords (if expanded; see Tagged Sections for
                        additional detail). The content included in Search can be
                        increased to included tag definitions, dimensions, and
                        authoritative references. See Settings for more information.
                    Search operators “and” (via “AND” or “&”)
                        and “or” (via “OR” or “|”) are available to further refine a
                        search. For example, and with Settings “Include References” on,
                        searching for “FASB AND 225” will highlight tagged data that is
                        related to FASB Codification topic 225.
                    Filters can be used in conjunction with Search
                        to further refine the scope of Search. Filters reduce the amount
                        of tagged facts that the keyword search is performed on. For
                        example, if “cash” is entered in conjunction with a Tags filter
                        of “Custom Only”, the shaded search results will only be
                        indicated on tagged facts based on a custom tag.

                            Filter

                    Filters change the number of highlighted facts
                        indicated by providing several ways to review the tagged
                        information. Multiple filters can be used at once. When the first
                        filter is applied, a filter toolbar indicates all active filter
                        selections and provides the ability to remove one or all applied
                        filters.
                    Data Filter
                    These filters options allow the user to refine
                        the highlighted tagged facts by data type:

                        All - Displays all tagged data (default)
                        Amounts Only - Numeric items only
                        Text Only - Textual items only
                        Calculations Only - Numeric items participating in a
                            calculation
                        Negatives Only - Numeric items with the Inline “sign”
                            option
                        Additional Items Only - Tagged items with potentially no
                            corresponding HTML presentation (i.e., hidden)

                    Tags Filter
                    These filters allow the user to refine the
                        highlighted facts by tag type:

                        Standard Only - Tags from a common taxonomy (e.g.,
                            US_GAAP, DEI)
                        Custom Only - Extension tags unique to the entity's
                            document

                    More Filters
                    Additional filters that allow user to further
                        refine the highlighted facts:

                        Periods - List of all used context reporting periods
                        Measures - List of all used units of measure; as
                            applicable
                        Axes - List of all used axes (dimensions); as applicable
                        Scale - List of all used scaled options (e.g.,
                            thousands, millions); as applicable
                        Balance - Debit, credit; as applicable

                    Multiple filters work in conjunction with each
                        other. For example, selecting the "Amounts Only" Data filter and
                        "Custom Only" Tags filter will highlight only numeric tagged
                        facts using custom tags. Active filters are displayed in the
                        Filter toolbar as they are selected. Active filters can be
                        removed individually by selecting the "X" icon to the right of
                        each filter, or all at once via the "Clear All" option.

                            Facts Results List

                    Selecting the down arrow "V" to the right of
                        the facts count on the toolbar reveals the Facts Results List; a
                        navigable listing of all currently highlighted tagged facts. By
                        default, all tagged facts are displayed in the Facts Results
                        List. The list content and count reflects the currently
                        highlighted facts (i.e., both Filters and Search criteria refine
                        the list to match the highlighted tagged facts). Navigation
                        controls are available to move through the list as well as move
                        the current view to the corresponding highlighted fact location
                        automatically. When a fact in the Facts Results List is selected,
                        it will reveal the Fact Review Window.
                    If the letter "A" appears for a fact, it
                        indicates the fact is additional data (i.e., hidden with
                        potentially no corresponding HTML presentation). If the letter
                        "C" appears, the fact is tagged with a custom tag. If the letter
                        "D" appears, the fact is tagged with dimensional information.

                            Information

                    The Information menu item provides additional
                        detail about the current Inline document and customizable viewer
                        settings.

                        Document - Basic company and document information
                        Tags - Fact and tag (standard and custom) information
                        Files - Files used
                        Additional Items - Additional data that's been tagged
                            but potentially does not have a corresponding location in the
                            HTML

                            Tagged Sections

                    The Tagged Sections toolbar/menu item provides
                        a listing of the tagged sections of the Inline document. By
                        selecting a section item in the listing, the document will
                        navigate to that section. When the Tagged Sections feature is
                        open, the Search box will additionally filter the list of
                        sections to only those sections that match the entered criteria.

                            Save XBRL Instance

                    The Save XBRL Instance menu item allows an XBRL
                        instance document (*.xml) that's extracted from the Inline
                        document to be saved locally.

                            Save XBRL Zip

                    The Save XBRL Zip menu item allows a zip file
                        (*.zip) that contains the as-provided XBRL instance document and
                        related custom taxonomy files to be saved locally.

                            Settings

                    The Settings menu item provides the ability to
                        customize Viewer features.
                    Highlight Colors

                        Tagged Data - Change the highlight color of the tagged
                            fact border
                        Search Results - Change the background color of tagged
                            items matching the Search results
                        Selected Fact - Change the color of highlight border
                            used to identify the currently selected fact
                        Tag Shading - Change the color of the shading applied to
                            tagged data

                    Search Options

                        Match Case - Matches the specific case of the entered
                            Search keyword
                        Include Labels - Extends Search to include tag labels
                        Include Definitions - Extends Search to include tag
                            definitions
                        Include Dimensions - Extends Search to include
                            dimensional detail
                        Include References - Extends Search to include
                            authoritative reference information

                    Tagged Fact Hover

                        Display - Displays the hover fact review window for any tagged fact*
                        Hide - Hides the hover fact review window for any tagged fact (default)

                    *May impact performance with certain web browsers.  

                Facts

                        Select Page

            Copy and Paste Below Content.

            Previous

            Next

        Settings

                Hover over Fact for
                    quick information.

                    On
                    Off

                Auto Scrolling
                    Position

                    Top
                    Center

                Selecting a
                    fact from the Sections Menu or the Fact Menu will automatically
                    scroll that element to the (Top, or Middle) of the viewer window.
                    This setting will have no use on IE 10, or Safari.

                    Tagged Data

                    Search Results

                    Selected Fact

                    Tag Shading (hover)

            Copy and Paste Below Content.

            Previous

            Next

            Nested Facts

            /

                    Previous

                    Next

            Copy and Paste Below Content.

            Previous

            Next

One important note is that when I tried retrieving the last two files, the second file was correctly the filing from 12-31-2018; while the first one, which should be the one from 12-31-2019, was still incorrect.

joeyism commented 4 years ago

Which version are you using? I published recently that should fix that

victor4shen commented 4 years ago

Thank you, updating to the latest version has fixed the issue!