mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Update Business Week Magazine
This commit is contained in:
parent
def42a1da3
commit
0e6cce50e6
@ -33,12 +33,11 @@ class BusinessWeekMagazine(BasicNewsRecipe):
|
||||
div0 = soup.find ('div', attrs={'class':'column left'})
|
||||
section_title = ''
|
||||
feeds = OrderedDict()
|
||||
for div in div0.findAll('h4'):
|
||||
articles = []
|
||||
for div in div0.findAll('a'):
|
||||
section_title = self.tag_to_string(div.findPrevious('h3')).strip()
|
||||
self.log('Processing section:', section_title)
|
||||
title=self.tag_to_string(div).strip()
|
||||
url=div['href']
|
||||
title=self.tag_to_string(div.a).strip()
|
||||
url=div.a['href']
|
||||
soup0 = self.index_to_soup(url)
|
||||
urlprint=soup0.find('li', attrs={'class':'print'}).a['href']
|
||||
articles.append({'title':title, 'url':urlprint, 'description':'', 'date':''})
|
||||
@ -48,15 +47,15 @@ class BusinessWeekMagazine(BasicNewsRecipe):
|
||||
if section_title not in feeds:
|
||||
feeds[section_title] = []
|
||||
feeds[section_title] += articles
|
||||
|
||||
div1 = soup.find ('div', attrs={'class':'column center'})
|
||||
section_title = ''
|
||||
for div in div1.findAll('h5'):
|
||||
articles = []
|
||||
for div in div1.findAll('a'):
|
||||
desc=self.tag_to_string(div.findNext('p')).strip()
|
||||
section_title = self.tag_to_string(div.findPrevious('h3')).strip()
|
||||
self.log('Processing section:', section_title)
|
||||
title=self.tag_to_string(div).strip()
|
||||
url=div['href']
|
||||
title=self.tag_to_string(div.a).strip()
|
||||
url=div.a['href']
|
||||
soup0 = self.index_to_soup(url)
|
||||
urlprint=soup0.find('li', attrs={'class':'print'}).a['href']
|
||||
articles.append({'title':title, 'url':urlprint, 'description':desc, 'date':''})
|
||||
@ -67,4 +66,3 @@ class BusinessWeekMagazine(BasicNewsRecipe):
|
||||
feeds[section_title] += articles
|
||||
ans = [(key, val) for key, val in feeds.iteritems()]
|
||||
return ans
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user