Last active
May 12, 2020 16:48
-
-
Save nukopy/6e1c64aa9489c8bcd570895f8074657e to your computer and use it in GitHub Desktop.
Web ページの <table> から Markdown 用のテーブルを吐き出す
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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