Update Handelsblatt

Merge branch 'handelsblatt-jul2021' of https://github.com/aimylios/calibre
This commit is contained in:
Kovid Goyal 2021-07-04 13:18:49 +05:30
commit 1b240e8882
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -63,18 +63,23 @@ class Handelsblatt(BasicNewsRecipe):
'vhb-teaser vhb-type-video']}),
dict(name='small', attrs={'class': ['vhb-credit']}),
dict(name='ul', attrs={'class': ['hcf-redaktion']}),
dict(name='div', attrs={'class': ['white_content', 'fb-post',
'opinary-widget-wrapper', 'dg_health',
dict(name='div', attrs={'class': ['dg_health', 'fb-post', 'header-bar',
'lb_consent--placeholder',
'lb-item embed', 'lb-post-actions',
'mod--displaynone', 'white_content',
'opinary-widget-wrapper',
'vhb-article__content-element--shorttextgallery',
'vhb-hollow-area vhb-hollow-area--col-1']}),
dict(name='div', attrs={'class': re.compile('stepstone')}),
dict(name='div', attrs={'class': re.compile('vhb-imagegallery')}),
dict(name='div', attrs={'id': ['highcharts_infografik']}),
dict(name='div', attrs={'id': re.compile('dax-sentiment')}),
dict(name=['div', 'section'], attrs={'class': re.compile('slider')}),
dict(name='a', attrs={'class': ['twitter-follow-button']}),
dict(name='img', attrs={'class': ['highlight-icon', 'lb-author__avatar']}),
dict(name='img', attrs={'alt': re.compile('Handelsblatt Morning Briefing')}),
dict(name='img', attrs={'alt': re.compile('Kolumnenkabinet')}),
dict(name=['link', 'blockquote'])
dict(name=['blockquote', 'button', 'link'])
]
preprocess_regexps = [
@ -97,6 +102,7 @@ class Handelsblatt(BasicNewsRecipe):
.vhb-teaser-head {margin-top: 1em; margin-bottom: 1em} \
.vhb-hollow-area--innercontent {font-size: 0.6em} \
.hcf-location-mark {font-weight: bold} \
.lb-post-header {margin-top: 1em} \
.panel-body p {margin-top: 0em}'
def get_browser(self):
@ -135,9 +141,9 @@ class Handelsblatt(BasicNewsRecipe):
for ul in row.findAll('ul'):
entry = ''
for li in ul.findAll(lambda tag: tag.name == 'li' and not tag.attrs):
entry = entry + self.tag_to_string(li).strip() + ', '
entry += self.tag_to_string(li).strip() + ', '
for li in ul.findAll(lambda tag: tag.name == 'li' and tag.attrs):
entry = entry + self.tag_to_string(li)
entry += self.tag_to_string(li)
ul.parent.replaceWith(entry)
# remove all local hyperlinks
for a in soup.findAll('a', {'href': True}):