Created
December 20, 2020 04:16
-
-
Save yuttie/b1e15afb3e2ea0e125d46e781f5346d4 to your computer and use it in GitHub Desktop.
This file contains 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 csv | |
from io import TextIOWrapper | |
from urllib.request import urlopen | |
with urlopen('https://www8.cao.go.jp/chosei/shukujitsu/syukujitsu.csv') as f: | |
if f.status == 200: | |
for row in csv.DictReader(TextIOWrapper(f, encoding='cp932', newline='')): | |
print(row) | |
else: | |
raise 'Something was wrong' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment