|
|
@@ -40,11 +40,9 @@ def LesezeichenD():
|
|
|
content = f.readlines()
|
|
|
lpars.feed(str(content))
|
|
|
watchlist = lpars.watchlist
|
|
|
- print(watchlist)
|
|
|
print('----------------------------')
|
|
|
for i in range (0,len(watchlist) - 1):
|
|
|
- print(watchlist[i])
|
|
|
- #print(str(i) + ' - ' + watchlist[i]['name'] + ' - ' + str(watchlist[i]['new']))
|
|
|
+ print(str(i) + ' - ' + watchlist[i]['name'] + ' - ' + str(watchlist[i]['new']))
|
|
|
|
|
|
class lesezeichenParser(HTMLParser):
|
|
|
inHeader = False
|
|
|
@@ -70,9 +68,7 @@ class lesezeichenParser(HTMLParser):
|
|
|
self.inRow = True
|
|
|
self.tdCount = 0
|
|
|
if self.inWatchlist:
|
|
|
- print('new dict')
|
|
|
self.anime = dict()
|
|
|
- print(self.anime)
|
|
|
|
|
|
#table data for parsing info
|
|
|
if self.inRow and tag == 'td':
|
|
|
@@ -91,7 +87,7 @@ class lesezeichenParser(HTMLParser):
|
|
|
self.anime['new'] = False
|
|
|
|
|
|
if (self.inWatchlist or self.inReadlist) and tag == 'th':
|
|
|
- inHeader = True
|
|
|
+ self.inHeader = True
|
|
|
|
|
|
def handle_endtag(self, tag):
|
|
|
if tag == 'h4' and self.inh4:
|
|
|
@@ -103,10 +99,9 @@ class lesezeichenParser(HTMLParser):
|
|
|
if tag == 'tr' and self.inRow:
|
|
|
self.inRow = False
|
|
|
if self.inHeader:
|
|
|
- inHeader = Flase
|
|
|
+ self.inHeader = False
|
|
|
else:
|
|
|
if self.inWatchlist:
|
|
|
- print('adding ' + str(self.anime))
|
|
|
self.watchlist.append(self.anime)
|
|
|
if tag == 'td' and self.inData:
|
|
|
self.inData = False
|
|
|
@@ -116,18 +111,18 @@ class lesezeichenParser(HTMLParser):
|
|
|
def handle_data(self, data):
|
|
|
if self.inh4 == True and data == 'Watchlist (Anime)':
|
|
|
self.inWatchlist = True
|
|
|
- print('Watchlist:')
|
|
|
+ #print('Watchlist:')
|
|
|
|
|
|
if self.inh4 and data == 'Readlist (Manga)':
|
|
|
self.inReadlist = True
|
|
|
- print('Readlist:')
|
|
|
+ #print('Readlist:')
|
|
|
|
|
|
if self.inName:
|
|
|
if self.inWatchlist:
|
|
|
self.anime['name'] = data
|
|
|
- print(' Anime: '+data)
|
|
|
- if self.inReadlist:
|
|
|
- print(' Manga: '+data)
|
|
|
+ #print(' Anime: '+data)
|
|
|
+ #if self.inReadlist:
|
|
|
+ #print(' Manga: '+data)
|
|
|
|
|
|
|
|
|
|