Pandas read_html results in TypeError

后端 未结 3 1850
耶瑟儿~
耶瑟儿~ 2021-01-14 06:02

I\'m using bs4 to parse a html page and extract a table, sample table given below and I\'m trying to load it into pandas but when i call pddataframe = pd.read_html(LOT

3条回答
  •  爱一瞬间的悲伤
    2021-01-14 06:39

    This exact code works for me.

    htm = """
    Learning Outcomes
    On successful completion of this module the learner will be able to:
    LO1 Demonstrate an awareness of the important role of Financial Accounting information as an input into the decision making process.
    LO2 Display an understanding of the fundamental accounting concepts, principles and conventions that underpin the preparation of Financial statements.
    LO3 Understand the various formats in which information in relation to transactions or events is recorded and classified.
    LO4 Apply a knowledge of accounting concepts,conventions and techniques such as double entry to the posting of recorded information to the T accounts in the Nominal Ledger.
    LO5 Prepare and present the financial statements of a Sole Trader in prescribed format from a Trial Balance accompanies by notes with additional information.
    """ pd.read_html(htm, skiprows=2, flavor='bs4')[0]

提交回复
热议问题