aktueller Stand

This commit is contained in:
hubobel 2019-02-12 20:19:52 +01:00
parent d5457380f7
commit 9775f8991d
22 changed files with 692 additions and 216 deletions

49
test.py
View file

@ -1,12 +1,39 @@
import pymysql
import bs4 as bs
import requests
from
file = open("LOTTO_ab_2017.csv", "br")
file=requests.get('http://www.lottotip-check.de')
#csv_reader = csv.reader(file, delimiter=",")
a=[]
for row in file:
print(row)
a.append(row)
file.close()
print(len(a))
print(a[len(a)-5])
connection = pymysql.connect(db="hubobel",
user="hubobel",
passwd="polier2003",
host='10.0.1.59',charset='utf8')
cursor = connection.cursor()
#todo eurojackpot wieder fixen
requests.packages.urllib3.disable_warnings()
sauce = requests.get('https://www.eurojackpot.org/gewinnzahlen/', verify=False)
soup = bs.BeautifulSoup(sauce.text, 'lxml')
#print(soup)
#print(soup)
# zahlen = []
# ergebniss = []
ZahlenEuro = {'Datum': '', 'Z1': '', 'Z2': '', 'Z3': '', 'Z4': '', 'Z5': '', 'Eurozahl1': '', 'Eurozahl2': ''}
a = 1
datum = soup.find_all('li')
for i in datum:
i=str(i)
i = i.replace('<li>' , '').replace('</li>' , '').replace('<li class="extra">' , '')
if a <= 7:
if a<6:
ZahlenEuro['Z'+str(a)]=i
if a ==6:
ZahlenEuro['Eurozahl1']=i
if a ==7:
ZahlenEuro['Eurozahl2']=i
a +=1
#print(soup)
sauce=(soup.find_all('div', class_ ='calendar'))
date=(soup.select_one('input[id=calendar]')['value'])
ZahlenEuro['Datum']=date
print(ZahlenEuro)