diff --git a/parser.py b/parser.py index 0b79251..256bbd7 100755 --- a/parser.py +++ b/parser.py @@ -55,7 +55,7 @@ class GoogleSheetsCalParser(HTMLParser): if not (self.row < 3 or (self.row - 2) % 12 < 2): self.inCell = True if 'rowspan' in dAttrs.keys(): - self.rowspan = dAttrs['rowspan'] + self.rowspan = int(dAttrs['rowspan']) else: self.rowspan = 1 elif (self.row - 2) % 12 == 1: self.inDate = True @@ -72,9 +72,10 @@ class GoogleSheetsCalParser(HTMLParser): def handle_data(self, data): if self.inDate: self.date = dt.strptime(data, '%d-%b-%y') - print(self.date) elif self.inCell and data not in ['', '-']: - print(data, self.row, self.column, self.rowspan) + times = [TIMETABLE[(self.row - 2) % 12 - 2][1], + TIMETABLE[(self.row - 2) % 12 - 2 + self.rowspan][0]] + print(data, self.date, times) # Getting the Google Sheet