Eurojackpot korrigiert und auf lotto24.de umgestellt
This commit is contained in:
parent
80d7a2ac9d
commit
95bc51dc34
50 changed files with 271 additions and 47 deletions
43
test.py
43
test.py
|
|
@ -1,6 +1,7 @@
|
|||
import pymysql
|
||||
import bs4 as bs
|
||||
import requests
|
||||
import time
|
||||
|
||||
connection = pymysql.connect(db="hubobel",
|
||||
user="hubobel",
|
||||
|
|
@ -14,26 +15,36 @@ 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)
|
||||
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)
|
||||
for i in datum:
|
||||
j = str(i)
|
||||
print(j)
|
||||
if j[:4] == '<li>':
|
||||
if j[:5] != '<li><':
|
||||
print(i)
|
||||
|
||||
|
||||
|
||||
for i in datum:
|
||||
j = str(i)
|
||||
#print(j)
|
||||
if j[:17] == '<li class="extra"':
|
||||
print(j[18:19])
|
||||
|
||||
print(ZahlenEuro)
|
||||
|
||||
sauce=(soup.find_all('div', class_ ='calendar'))
|
||||
date=(soup.select_one('input[id=calendar]')['value'])
|
||||
ZahlenEuro['Datum']=date
|
||||
print(ZahlenEuro)
|
||||
print(sauce)
|
||||
#date=(soup.select_one('input[id=calendar]')['value'])
|
||||
#ZahlenEuro['Datum']=date
|
||||
|
||||
tag=int((time.strftime("%w")))
|
||||
if tag == 6:
|
||||
datum = (time.strftime("%d.%m.%Y"))
|
||||
print(datum)
|
||||
Loading…
Add table
Add a link
Reference in a new issue