Skip to content

Instantly share code, notes, and snippets.

@moriya9n
Last active May 5, 2018 04:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save moriya9n/9b01fa0938d10b69a5515434d5866589 to your computer and use it in GitHub Desktop.
Save moriya9n/9b01fa0938d10b69a5515434d5866589 to your computer and use it in GitHub Desktop.
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