Skip to content

Instantly share code, notes, and snippets.

@nukopy
Last active May 12, 2020 16:48
Show Gist options
  • Select an option

  • Save nukopy/6e1c64aa9489c8bcd570895f8074657e to your computer and use it in GitHub Desktop.

Select an option

Save nukopy/6e1c64aa9489c8bcd570895f8074657e to your computer and use it in GitHub Desktop.
Web ページの <table> から Markdown 用のテーブルを吐き出す
import pandas as pd
def main():
# requirements: pandas, lxml, tabulate
# 正規表現のサイトから「記号」のテーブルを抽出し,Markdown 用のテーブルを出力
url = 'https://murashun.jp/blog/20190215-01.html'
list_table = pd.read_html(url)
for t in list_table:
print(t.to_markdown())
if __name__ == "__main__":
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment