jestin
from html_table_parser  import HTMLTableParser

def tableParse(value):
    p = HTMLTableParser()
    p.feed(value)
    print(p.tables)
import pandas as pd

def framParse(value):
        soup=BeautifulSoup(value, 'html.parser')
        tables = soup.select('table')
        print(tables)
        df_list = []
        for table in tables:
            print(pd.read_html(table.prettify()))
            df_list.append(pd.concat(pd.read_html(table.prettify())))
        df = pd.concat(df_list)
        df.to_excel('vscode快捷键大全.xlsx')

以上两种方式均可以解析标准表格

分类:

技术点:

相关文章:

  • 2021-12-22
  • 2021-11-01
  • 2021-11-30
  • 2021-09-27
  • 2021-09-14
  • 2021-09-09
  • 2021-09-09
  • 2021-10-07
猜你喜欢
  • 2021-09-09
  • 2021-12-09
  • 2021-09-09
  • 2021-09-09
  • 2021-11-19
  • 2021-08-01
  • 2021-11-01
相关资源
相似解决方案