from pathlib import Path from markdownify import markdownify source = Path("input.html").read_text(encoding="utf-8") result = markdownify(source, bs4_options="html.parser", table_infer_header=False) Path("output.md").write_text(result, encoding="utf-8")