mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
save link to last number in a variable instead of finding it out again and again
This commit is contained in:
parent
f6b32541e6
commit
b59c3778a3
@ -30,7 +30,8 @@ class GN(BasicNewsRecipe):
|
|||||||
return page[4]
|
return page[4]
|
||||||
|
|
||||||
def parse_index(self):
|
def parse_index(self):
|
||||||
soup = self.index_to_soup('http://gosc.pl' + self.find_last_issue())
|
self.last_issue = self.find_last_issue()
|
||||||
|
soup = self.index_to_soup('http://gosc.pl' + self.last_issue)
|
||||||
self.cover_url = 'http://www.gosc.pl' + soup.find('div',attrs={'class':'fl-w100 release-wp'}).findAll('a')[-4].contents[0]['src']
|
self.cover_url = 'http://www.gosc.pl' + soup.find('div',attrs={'class':'fl-w100 release-wp'}).findAll('a')[-4].contents[0]['src']
|
||||||
feeds = []
|
feeds = []
|
||||||
enlisted = []
|
enlisted = []
|
||||||
@ -57,7 +58,7 @@ class GN(BasicNewsRecipe):
|
|||||||
page = 1
|
page = 1
|
||||||
not_assigned = []
|
not_assigned = []
|
||||||
while True:
|
while True:
|
||||||
soup = self.index_to_soup('http://gosc.pl' + self.find_last_issue().replace('przeglad','wszystko') + '/' + str(page))
|
soup = self.index_to_soup('http://gosc.pl' + self.last_issue.replace('przeglad','wszystko') + '/' + str(page))
|
||||||
articles = list(self.find_articles(soup))
|
articles = list(self.find_articles(soup))
|
||||||
not_assigned.extend([x for x in articles if x.get('url') not in enlisted])
|
not_assigned.extend([x for x in articles if x.get('url') not in enlisted])
|
||||||
page+=1
|
page+=1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user