Last active
May 5, 2018 03:54
-
-
Save moriya9n/54d47757e75eaaafc5af2c48513d6aca 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
#!/usr/bin/env python | |
import requests | |
import csv | |
# list | |
r = requests.get('https://www.mizuhobank.co.jp/retail/takarakuji/loto/loto6/csv/loto6.csv') | |
r.encoding='cp932' | |
loto6_list = [i[1:5] for i in r.text.splitlines() if i.startswith('第')] | |
# latest | |
r = requests.get('https://www.mizuhobank.co.jp/retail/takarakuji/loto/loto6/csv/A102%s.CSV' % loto6_list[0]) | |
r.encoding='cp932' | |
loto6_result = r.text.splitlines() | |
reader = csv.reader(loto6_result) | |
for l in reader: | |
print(l) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment