html格式转md格式

# 模块html2text

pip install html2text/pip3 install html2text

  

测试:

import html2text as ht
text_maker = ht.HTML2Text()
# 读取html格式文件
with open('./*.html', 'r', encoding='UTF-8') as f:
    htmlpage = f.read()
# 处理html格式文件中的内容
text = text_maker.handle(htmlpage)
# 写入处理后的内容
with open('*.md', 'w') as f:
    f.write(text)

  

相关文章:

  • 2021-12-22
  • 2021-11-14
  • 2021-07-13
  • 2022-12-23
  • 2021-10-01
  • 2022-12-23
  • 2021-10-04
猜你喜欢
  • 2022-12-23
  • 2021-06-30
  • 2022-12-23
  • 2022-12-23
  • 2021-08-26
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案