Skip to content

Instantly share code, notes, and snippets.

@moriya9n moriya9n/loto6_latest.py
Last active May 5, 2018

Embed
What would you like to do?
loto6 最新
#!/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
You can’t perform that action at this time.