replaced strip with regex replace
Signed-off-by: klux2 <k.lux.gm@gmail.com>
This commit is contained in:
parent
5a565237e6
commit
3b5044e536
1 changed files with 2 additions and 1 deletions
|
@ -9,6 +9,7 @@ import traceback
|
|||
import urllib.request
|
||||
import xml.etree.ElementTree as ET
|
||||
from enum import Enum
|
||||
from re import sub
|
||||
from time import time
|
||||
from typing import Any
|
||||
from urllib.error import HTTPError
|
||||
|
@ -297,7 +298,7 @@ async def get_essen(only_today: bool) -> None:
|
|||
for i in menus:
|
||||
kategorie = i.findall("type")[0].text
|
||||
essen_transl.append(kategorie)
|
||||
name = i.findall("description")[0].text.rstrip("()1234567890, ")
|
||||
name = sub("\\s*\\([0-9A-Z, ]*\\)", "", i.findall("description")[0].text)
|
||||
essen_transl.append(name)
|
||||
try:
|
||||
preis = float(i.findall("./prices/price[label='Studenten']/value")[0].text.replace(",", "."))
|
||||
|
|
Loading…
Reference in a new issue