mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Update Go Comics
This commit is contained in:
parent
97ee60c5a0
commit
3809604157
@ -552,11 +552,13 @@ class GoComics(BasicNewsRecipe):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
def parse_comic_page(self, content):
|
def parse_comic_page(self, content):
|
||||||
img = content.find('img')
|
a = content.find('a', itemprop='image')
|
||||||
|
if a is None:
|
||||||
|
raise StopIteration()
|
||||||
|
img = a.find('img')
|
||||||
if img is None:
|
if img is None:
|
||||||
raise StopIteration()
|
raise StopIteration()
|
||||||
img['srcset'] = ''
|
img['srcset'] = ''
|
||||||
a = content.find('a', title=True)
|
|
||||||
title_parts = a['title'].split()
|
title_parts = a['title'].split()
|
||||||
title = ' '.join(title_parts[:-2])
|
title = ' '.join(title_parts[:-2])
|
||||||
return {'h1':title, 'date':title_parts[-1], 'img':str(img)}
|
return {'h1':title, 'date':title_parts[-1], 'img':str(img)}
|
||||||
@ -579,7 +581,7 @@ class GoComics(BasicNewsRecipe):
|
|||||||
page_soup = self.index_to_soup(url)
|
page_soup = self.index_to_soup(url)
|
||||||
if not page_soup:
|
if not page_soup:
|
||||||
break
|
break
|
||||||
content = page_soup.find(attrs={'class':'comic__image'})
|
content = page_soup.find(attrs={'class': lambda x: x and 'comic__image' in x.split()})
|
||||||
if content is None:
|
if content is None:
|
||||||
break
|
break
|
||||||
current_articles.append(self.parse_comic_page(content))
|
current_articles.append(self.parse_comic_page(content))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user