Eurojackpot korrigiert und auf lotto24.de umgestellt
1
.idea/dictionaries/hubobel.xml
generated
|
|
@ -5,6 +5,7 @@
|
|||
<w>farbe</w>
|
||||
<w>fyeg</w>
|
||||
<w>gibt</w>
|
||||
<w>gibts</w>
|
||||
<w>nicht</w>
|
||||
</words>
|
||||
</dictionary>
|
||||
|
|
|
|||
|
|
@ -3,12 +3,16 @@
|
|||
import requests
|
||||
import telebot
|
||||
import datetime
|
||||
import json
|
||||
from datetime import datetime as DateTime
|
||||
|
||||
hour = datetime.datetime.now().hour
|
||||
TOKEN='680737840:AAEaa7Vxl_kZz_LWS1_S-lH6Eda7HXqu6Y4'
|
||||
ChatID='322673713'
|
||||
tb = telebot.TeleBot(TOKEN)
|
||||
|
||||
ort = '/home/carsten/Scripts/'
|
||||
ort = ''
|
||||
Zeitstempel = DateTime.now().strftime('%Y_%m_%d_%H_%M_%S')
|
||||
antwort=''
|
||||
|
||||
def mzwi():
|
||||
|
|
@ -16,6 +20,8 @@ def mzwi():
|
|||
resp_zitat = requests.get(url_zitat)
|
||||
data_zitat = resp_zitat.json()
|
||||
telegramm = 'Mainz - Wiesbaden\n'
|
||||
with open(ort + str(Zeitstempel) + '_data.txt', 'w') as outfile:
|
||||
json.dump(data_zitat, outfile)
|
||||
for i in data_zitat['departures']:
|
||||
if i['train'] == "S 8":
|
||||
if i['destination'] == 'Wiesbaden Hbf':
|
||||
|
|
@ -44,6 +50,8 @@ def wimz():
|
|||
resp_zitat = requests.get(url_zitat)
|
||||
data_zitat = resp_zitat.json()
|
||||
telegramm = 'Wiesbaden - Mainz\n'
|
||||
with open(ort + str(Zeitstempel) + '_data.txt', 'w') as outfile:
|
||||
json.dump(data_zitat, outfile)
|
||||
for i in data_zitat['departures']:
|
||||
if i['train'] == "S 8":
|
||||
if i['destination'] == 'Offenbach(Main)Ost':
|
||||
|
|
@ -75,6 +83,8 @@ def mzaz():
|
|||
resp_zitat = requests.get(url_zitat)
|
||||
data_zitat = resp_zitat.json()
|
||||
telegramm = 'Mainz - Alzey\n'
|
||||
with open(ort + str(Zeitstempel) + '_data.txt', 'w') as outfile:
|
||||
json.dump(data_zitat, outfile)
|
||||
for i in data_zitat['departures']:
|
||||
if i['train'] == "RE 13":
|
||||
if i['delayDeparture'] != None:
|
||||
|
|
@ -105,6 +115,8 @@ def azmz():
|
|||
resp_zitat = requests.get(url_zitat)
|
||||
data_zitat = resp_zitat.json()
|
||||
telegramm = 'Alzey - Mainz\n'
|
||||
with open(ort + str(Zeitstempel) + '_data.txt', 'w') as outfile:
|
||||
json.dump(data_zitat, outfile)
|
||||
for i in data_zitat['departures']:
|
||||
# print(i)
|
||||
if i['train'] == "RE 13":
|
||||
|
|
|
|||
BIN
Bild
Normal file
|
After Width: | Height: | Size: 388 KiB |
117
Chuck2SQL.py
Normal file
|
|
@ -0,0 +1,117 @@
|
|||
# -*- coding: UTF8 -*-
|
||||
import requests
|
||||
import datetime
|
||||
import pymysql
|
||||
|
||||
|
||||
|
||||
class BotHandler:
|
||||
def __init__(self, token):
|
||||
self.token = token
|
||||
self.api_url = "https://api.telegram.org/bot{}/".format(token)
|
||||
|
||||
#url = "https://api.telegram.org/bot<token>/"
|
||||
|
||||
def get_updates(self, offset=0, timeout=30):
|
||||
method = 'getUpdates'
|
||||
params = {'timeout': timeout, 'offset': offset}
|
||||
resp = requests.get(self.api_url + method, params)
|
||||
result_json = resp.json()['result']
|
||||
return result_json
|
||||
|
||||
def send_message(self, chat_id, text):
|
||||
params = {'chat_id': chat_id, 'text': text, 'parse_mode': 'HTML'}
|
||||
method = 'sendMessage'
|
||||
resp = requests.post(self.api_url + method, params)
|
||||
return resp
|
||||
|
||||
def get_first_update(self):
|
||||
get_result = self.get_updates()
|
||||
|
||||
if len(get_result) > 0:
|
||||
last_update = get_result[0]
|
||||
else:
|
||||
last_update = None
|
||||
|
||||
return last_update
|
||||
|
||||
|
||||
token = '1030619458:AAGTrWO2-m38ViL0y2R8XaV0P1gg8kHxj3o' #Token of your bot
|
||||
magnito_bot = BotHandler(token) #Your bot's name
|
||||
|
||||
|
||||
|
||||
def main():
|
||||
new_offset = 0
|
||||
print('hi, now launching...')
|
||||
|
||||
while True:
|
||||
|
||||
all_updates=magnito_bot.get_updates(new_offset)
|
||||
|
||||
if len(all_updates) > 0:
|
||||
for current_update in all_updates:
|
||||
print(current_update)
|
||||
first_update_id = current_update['update_id']
|
||||
|
||||
if 'text' not in current_update['message']:
|
||||
first_chat_text='New member'
|
||||
else:
|
||||
first_chat_text = current_update['message']['text']
|
||||
first_chat_id = current_update['message']['chat']['id']
|
||||
if 'first_name' in current_update['message']:
|
||||
first_chat_name = current_update['message']['chat']['first_name']
|
||||
elif 'new_chat_member' in current_update['message']:
|
||||
first_chat_name = current_update['message']['new_chat_member']['username']
|
||||
elif 'from' in current_update['message']:
|
||||
first_chat_name = current_update['message']['from']['first_name']
|
||||
else:
|
||||
first_chat_name = "unknown"
|
||||
signal = first_chat_text[0:5]
|
||||
|
||||
if signal == '/0815':
|
||||
magnito_bot.send_message(first_chat_id, 'Ich lausche deinem Befehl ' + first_chat_name)
|
||||
new_offset = first_update_id + 1
|
||||
connection = pymysql.connect(db="hubobel",
|
||||
user="hubobel",
|
||||
passwd="polier2003",
|
||||
host='10.0.1.59', charset='utf8')
|
||||
cursor = connection.cursor()
|
||||
sql = "SELECT * FROM facts ORDER BY nr DESC"
|
||||
resp = cursor.execute(sql)
|
||||
x = int(resp)
|
||||
magnito_bot.send_message(first_chat_id, 'Es gibt derzeit ' + str(x) + ' Facts')
|
||||
|
||||
fact = first_chat_text[6:]
|
||||
|
||||
sql = "INSERT INTO `facts`(`nr`, `fact`) VALUES ('" + str(x+1) + "','" + fact + "')"
|
||||
sql_q = "SELECT * FROM facts WHERE fact like '%" + fact + "%'"
|
||||
resp = cursor.execute(sql_q)
|
||||
if resp == 0:
|
||||
try:
|
||||
resp = cursor.execute(sql)
|
||||
magnito_bot.send_message(first_chat_id, 'Ich habe diesen Fact an SQL übertragen: ' + fact)
|
||||
except:
|
||||
magnito_bot.send_message(first_chat_id, 'Ich hatte ein Problem, den Fact an SQL zu übermitteln!')
|
||||
else:
|
||||
magnito_bot.send_message(first_chat_id, 'Den Fact "' + fact+ ' "gibt es schon in meiner Database!')
|
||||
connection.commit()
|
||||
cursor.close()
|
||||
connection.close()
|
||||
else:
|
||||
if first_chat_text == 'Hi':
|
||||
magnito_bot.send_message(first_chat_id, 'Morning ' + first_chat_name)
|
||||
new_offset = first_update_id + 1
|
||||
elif first_chat_text == 'Wer bin ich':
|
||||
magnito_bot.send_message(first_chat_id, 'Du bist der Größte '+ signal)
|
||||
new_offset = first_update_id + 1
|
||||
else:
|
||||
magnito_bot.send_message(first_chat_id, 'How are you doing '+first_chat_name)
|
||||
new_offset = first_update_id + 1
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
try:
|
||||
main()
|
||||
except KeyboardInterrupt:
|
||||
exit()
|
||||
32
Euro2SQL.py
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
import bs4 as bs
|
||||
import requests
|
||||
|
||||
requests.packages.urllib3.disable_warnings()
|
||||
sauce = requests.get('https://www.lotto24.de/webshop/product/eurojackpot/result', verify=False)
|
||||
soup = bs.BeautifulSoup(sauce.text, 'lxml')
|
||||
|
||||
ZahlenEuro = {'Datum': '', 'Z1': '', 'Z2': '', 'Z3': '', 'Z4': '', 'Z5': '', 'Eurozahl1': '', 'Eurozahl2': ''}
|
||||
a = 1
|
||||
daten = soup.find_all('div', class_="winning-numbers__number")
|
||||
for i in daten:
|
||||
print(i.text)
|
||||
if a <= 5:
|
||||
ZahlenEuro['Z' + str(a)] = int(i.text)
|
||||
elif a == 6:
|
||||
ZahlenEuro['Eurozahl1'] = int(i.text)
|
||||
elif a == 7:
|
||||
ZahlenEuro['Eurozahl2'] = int(i.text)
|
||||
a = a + 1
|
||||
|
||||
daten = soup.find_all('h2', class_="strong hidden-xs")
|
||||
for i in daten:
|
||||
date = i.text
|
||||
date = date.replace(' ', '')
|
||||
date = date.replace('\n', '')
|
||||
|
||||
start = (date.find('dem')) + 4
|
||||
ende = (date.find('(Alle'))
|
||||
ZahlenEuro['Datum'] = date[start:ende]
|
||||
print(ZahlenEuro)
|
||||
|
||||
|
||||
|
|
@ -16,17 +16,18 @@ except:
|
|||
None
|
||||
sql = "SELECT * FROM Filosofie ORDER BY Nr DESC"
|
||||
resp = cursor.execute(sql)
|
||||
AnzahlStart=resp
|
||||
db=[]
|
||||
ergebniss=''
|
||||
AnzahlStart = resp
|
||||
db = []
|
||||
ergebniss = ''
|
||||
requests.packages.urllib3.disable_warnings()
|
||||
sauce = requests.get('https://www.swr3.de/wraps/fun/filosofie/neu.php?id=1151', verify=False)
|
||||
sauce = requests.get('https://www.swr3.de/wraps/fun/filosofie/neu.php?id=1300', verify=False)
|
||||
soup = bs.BeautifulSoup(sauce.text, 'lxml')
|
||||
for i in soup.find_all('div'):
|
||||
ergebniss=ergebniss+str(i)
|
||||
start=(ergebniss.find('href="/wraps/fun/filosofie/neu.php?id=1152&cf=42"> weiter > </a> <a class="linkred" href='))
|
||||
anzahl=int(ergebniss[start+131:start+135])
|
||||
start=int(resp)+1+110
|
||||
ergebniss = ergebniss+str(i)
|
||||
start = (ergebniss.find('href="/wraps/fun/filosofie/neu.php?id=1152&cf=42"> weiter > </a> <a class="linkred" href='))
|
||||
print(ergebniss)
|
||||
anzahl = int(ergebniss[start+131:start+135])
|
||||
start = int(resp)+1+110
|
||||
|
||||
while start <= anzahl:
|
||||
url='https://www.swr3.de/wraps/fun/filosofie/neu.php?id='+str(start)
|
||||
|
|
|
|||
52
Lotto2SQL.py
|
|
@ -1,6 +1,7 @@
|
|||
import pymysql
|
||||
import bs4 as bs
|
||||
import requests
|
||||
import time
|
||||
|
||||
connection = pymysql.connect(db="hubobel",
|
||||
user="hubobel",
|
||||
|
|
@ -8,36 +9,38 @@ connection = pymysql.connect(db="hubobel",
|
|||
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)
|
||||
sauce = requests.get('https://www.lotto24.de/webshop/product/eurojackpot/result', verify=False)
|
||||
soup = bs.BeautifulSoup(sauce.text, 'lxml')
|
||||
|
||||
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
|
||||
daten = soup.find_all('div', class_="winning-numbers__number")
|
||||
for i in daten:
|
||||
#print(i.text)
|
||||
if a <= 5:
|
||||
ZahlenEuro['Z' + str(a)] = int(i.text)
|
||||
elif a == 6:
|
||||
ZahlenEuro['Eurozahl1'] = int(i.text)
|
||||
elif a == 7:
|
||||
ZahlenEuro['Eurozahl2'] = int(i.text)
|
||||
a = a + 1
|
||||
|
||||
sauce=(soup.find_all('div', class_ ='calendar'))
|
||||
date=(soup.select_one('input[id=calendar]')['value'])
|
||||
ZahlenEuro['Datum']=date
|
||||
daten = soup.find_all('h2', class_="strong hidden-xs")
|
||||
for i in daten:
|
||||
date = i.text
|
||||
date = date.replace(' ', '')
|
||||
date = date.replace('\n', '')
|
||||
|
||||
start = (date.find('dem')) + 4
|
||||
ende = (date.find('(Alle'))
|
||||
ZahlenEuro['Datum'] = date[start:ende]
|
||||
|
||||
requests.packages.urllib3.disable_warnings()
|
||||
sauce = requests.get('https://www.lotto24.de/webshop/product/lottonormal/result', verify=False)
|
||||
soup = bs.BeautifulSoup(sauce.text, 'lxml')
|
||||
|
||||
# print(soup.prettify())
|
||||
Lottozahlen = {'Datum': '', 'Z1': '', 'Z2': '', 'Z3': '', 'Z4': '', 'Z5': '', 'Z6': '', 'Superzahl': '',
|
||||
'Spiel77': '', 'Super6': ''}
|
||||
daten = soup.find_all('div', class_="winning-numbers__number")
|
||||
|
|
@ -75,15 +78,15 @@ Lottozahlen['Spiel77'] = Spiel77
|
|||
Lottozahlen['Super6'] = Super6
|
||||
Lottozahlen['Datum'] = date[start:ende]
|
||||
|
||||
#print(ZahlenEuro)
|
||||
print(Lottozahlen)
|
||||
print(date)
|
||||
|
||||
|
||||
|
||||
try:
|
||||
cursor.execute("""CREATE TABLE euro (
|
||||
datum Text, z1 INTEGER, z2 INTEGER, z3 INTEGER, z4 INTEGER, z5 INTEGER, sz1 INTEGER, sz2 INTEGER )""")
|
||||
except:
|
||||
None
|
||||
|
||||
data = ZahlenEuro
|
||||
sql = "INSERT INTO `euro`(`datum`, `z1`, `z2`, `z3`, `z4`, `z5`, `sz1`, `sz2`) VALUES" \
|
||||
" ('" + str(data['Datum']) + "','" + str(data['Z1']) + "','" + str(data['Z2']) + "','" + str(data['Z3']) + \
|
||||
|
|
@ -146,3 +149,10 @@ if resp == 0:
|
|||
connection.commit()
|
||||
cursor.close()
|
||||
connection.close()
|
||||
|
||||
tag=int((time.strftime("%w")))
|
||||
if tag != 5:
|
||||
print(Lottozahlen)
|
||||
elif tag == 7:
|
||||
print(ZahlenEuro)
|
||||
print(ZahlenEuro)
|
||||
11
Test4_Pfad.py
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
import os
|
||||
import time
|
||||
path = "testa"
|
||||
monat = (time.strftime("%m"))
|
||||
jahr = (time.strftime("%Y"))
|
||||
|
||||
path = path + '/' + jahr + '/' + monat
|
||||
if os.path.exists(path) == False:
|
||||
print('gibts nicht')
|
||||
os.makedirs(path)
|
||||
|
||||
27
Timelapse.py
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
import urllib.request
|
||||
import requests
|
||||
from datetime import datetime as DateTime
|
||||
import time
|
||||
import os
|
||||
path = os.getcwd() + "/cameras/wz"
|
||||
print(path)
|
||||
monat = (time.strftime("%m"))
|
||||
jahr = (time.strftime("%Y"))
|
||||
tag = (time.strftime("%d"))
|
||||
|
||||
path = path + '/' + jahr + '/' + monat + '/' + tag
|
||||
|
||||
if not os.path.exists(path):
|
||||
print('gibts nicht')
|
||||
os.makedirs(path)
|
||||
|
||||
while True:
|
||||
url_WZ = 'http://10.0.1.241/api.cgi?cmd=GetMdState&user=admin&password=polier2003'
|
||||
resp_WZ = requests.get(url_WZ)
|
||||
data_WZ = resp_WZ.json()
|
||||
motion_wz = data_WZ[0]['value']['state']
|
||||
if motion_wz == 1:
|
||||
Zeit = DateTime.now().strftime('%H_%M_%S')
|
||||
url = 'http://10.0.1.241/cgi-bin/api.cgi?cmd=Snap&channel=0&rs=wuuPhkmUCeI9WG7C&user=admin&password=polier2003'
|
||||
urllib.request.urlretrieve(url, path + '/Bild'+Zeit+'.jpg')
|
||||
time.sleep(2)
|
||||
BIN
cameras/wz/2020/02/29/Bild14_57_15.jpg
Normal file
|
After Width: | Height: | Size: 397 KiB |
BIN
cameras/wz/2020/02/29/Bild14_58_08.jpg
Normal file
|
After Width: | Height: | Size: 356 KiB |
BIN
cameras/wz/2020/02/29/Bild14_58_10.jpg
Normal file
|
After Width: | Height: | Size: 378 KiB |
BIN
cameras/wz/2020/02/29/Bild14_58_17.jpg
Normal file
|
After Width: | Height: | Size: 347 KiB |
BIN
cameras/wz/2020/02/29/Bild14_58_20.jpg
Normal file
|
After Width: | Height: | Size: 350 KiB |
BIN
cameras/wz/2020/02/29/Bild14_58_24.jpg
Normal file
|
After Width: | Height: | Size: 352 KiB |
BIN
cameras/wz/2020/02/29/Bild14_58_45.jpg
Normal file
|
After Width: | Height: | Size: 346 KiB |
BIN
cameras/wz/2020/02/29/Bild14_58_48.jpg
Normal file
|
After Width: | Height: | Size: 348 KiB |
BIN
cameras/wz/2020/02/29/Bild14_58_59.jpg
Normal file
|
After Width: | Height: | Size: 342 KiB |
BIN
cameras/wz/2020/02/29/Bild14_59_01.jpg
Normal file
|
After Width: | Height: | Size: 342 KiB |
BIN
cameras/wz/2020/02/29/Bild14_59_14.jpg
Normal file
|
After Width: | Height: | Size: 347 KiB |
BIN
cameras/wz/2020/02/29/Bild14_59_16.jpg
Normal file
|
After Width: | Height: | Size: 343 KiB |
BIN
cameras/wz/2020/02/29/Bild14_59_19.jpg
Normal file
|
After Width: | Height: | Size: 340 KiB |
BIN
cameras/wz/2020/02/29/Bild14_59_21.jpg
Normal file
|
After Width: | Height: | Size: 331 KiB |
BIN
cameras/wz/2020/02/29/Bild14_59_24.jpg
Normal file
|
After Width: | Height: | Size: 348 KiB |
BIN
cameras/wz/2020/02/29/Bild14_59_26.jpg
Normal file
|
After Width: | Height: | Size: 345 KiB |
BIN
cameras/wz/2020/02/29/Bild14_59_43.jpg
Normal file
|
After Width: | Height: | Size: 344 KiB |
BIN
cameras/wz/2020/02/29/Bild14_59_46.jpg
Normal file
|
After Width: | Height: | Size: 341 KiB |
BIN
cameras/wz/2020/02/29/Bild14_59_48.jpg
Normal file
|
After Width: | Height: | Size: 342 KiB |
BIN
cameras/wz/2020/02/29/Bild14_59_51.jpg
Normal file
|
After Width: | Height: | Size: 344 KiB |
BIN
cameras/wz/2020/02/29/Bild14_59_53.jpg
Normal file
|
After Width: | Height: | Size: 342 KiB |
BIN
cameras/wz/2020/02/29/Bild14_59_56.jpg
Normal file
|
After Width: | Height: | Size: 348 KiB |
BIN
cameras/wz/2020/02/29/Bild14_59_58.jpg
Normal file
|
After Width: | Height: | Size: 348 KiB |
BIN
cameras/wz/2020/02/29/Bild15_00_01.jpg
Normal file
|
After Width: | Height: | Size: 358 KiB |
BIN
cameras/wz/2020/02/29/Bild15_00_03.jpg
Normal file
|
After Width: | Height: | Size: 359 KiB |
BIN
cameras/wz/2020/02/29/Bild15_00_06.jpg
Normal file
|
After Width: | Height: | Size: 358 KiB |
BIN
cameras/wz/2020/02/29/Bild15_00_08.jpg
Normal file
|
After Width: | Height: | Size: 357 KiB |
BIN
cameras/wz/2020/02/29/Bild15_00_11.jpg
Normal file
|
After Width: | Height: | Size: 358 KiB |
BIN
cameras/wz/2020/02/29/Bild15_00_13.jpg
Normal file
|
After Width: | Height: | Size: 398 KiB |
BIN
cameras/wz/2020/02/29/Bild15_00_18.jpg
Normal file
|
After Width: | Height: | Size: 344 KiB |
BIN
cameras/wz/2020/02/29/Bild15_00_20.jpg
Normal file
|
After Width: | Height: | Size: 350 KiB |
BIN
cameras/wz/2020/02/29/Bild15_00_23.jpg
Normal file
|
After Width: | Height: | Size: 385 KiB |
BIN
cameras/wz/2020/02/29/Bild15_00_26.jpg
Normal file
|
After Width: | Height: | Size: 349 KiB |
BIN
cameras/wz/2020/02/29/Bild15_00_28.jpg
Normal file
|
After Width: | Height: | Size: 351 KiB |
BIN
cameras/wz/2020/02/29/Bild16_07_54.jpg
Normal file
|
After Width: | Height: | Size: 317 KiB |
BIN
cameras/wz/2020/02/29/Bild16_07_56.jpg
Normal file
|
After Width: | Height: | Size: 336 KiB |
BIN
cameras/wz/2020/02/29/Bild16_08_34.jpg
Normal file
|
After Width: | Height: | Size: 334 KiB |
BIN
cameras/wz/2020/02/29/Bild16_08_37.jpg
Normal file
|
After Width: | Height: | Size: 338 KiB |
1
data.txt
Normal file
1
data.txt2019_12_23_20_19_33
Normal file
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)
|
||||
sauce=(soup.find_all('div', class_ ='calendar'))
|
||||
date=(soup.select_one('input[id=calendar]')['value'])
|
||||
ZahlenEuro['Datum']=date
|
||||
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'))
|
||||
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)
|
||||