From 812e163169f40075a461b545ddd6f214631e3b1c Mon Sep 17 00:00:00 2001 From: edpibu Date: Sun, 20 Sep 2020 21:14:12 +0200 Subject: [PATCH] Fixed __init__ and removed print --- parser.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/parser.py b/parser.py index cb4c702..0a16231 100755 --- a/parser.py +++ b/parser.py @@ -20,16 +20,19 @@ class GoogleSheetsCalParser(HTMLParser): self.inTable = False self.row = 0 self.column = 0 - self.__init__() + HTMLParser.__init__(self) def handle_starttag(self, tag, attrs): - print(1) + if self.inTable: + ... + elif tag == 'table': + self.inTable = True def handle_endtag(self, tag): - print(1) + ... def handle_data(self, data): - print(1) + ... # Getting the Google Sheet @@ -44,7 +47,7 @@ if r.status_code != 200: sys.exit(1) # Parsing the Sheet -calParser = GoogleSheetsParser() +calParser = GoogleSheetsCalParser() calParser.feed(r.text) # Transforming the cells into events