Make debug output better readable

This commit is contained in:
Christian Wolf 2022-12-03 14:29:01 +01:00
parent 5d141113aa
commit 15eec712f2

View File

@ -19,9 +19,16 @@ class HtmlImport:
class HtmlParser:
def __init__(self, text: str):
def __init__(self, text: str, fileName: str = None):
self.l = logging.getLogger('solo_turnier.html_parser')
self.soup = BeautifulSoup(text, 'html.parser')
self.fileName = fileName
def __repr__(self):
if self.fileName is None:
return 'HtmlParser(direct text)'
else:
return f'HtmlParser({self.fileName})'
def getEventTitle(self):
return self.soup.find('div', class_='eventhead').table.tr.td.contents[0]