Last active
May 5, 2018 04:20
-
-
Save moriya9n/9b01fa0938d10b69a5515434d5866589 to your computer and use it in GitHub Desktop.
loto6 最新
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()[3] | |
nums = loto6_result.split(',') | |
main = [int(i) for i in nums[1:7]] | |
bonus = int(nums[8]) | |
print(main) | |
print(bonus) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment