mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Remove other tag cruft
This commit is contained in:
parent
d1395dba2b
commit
5ba018e7ed
@ -39,6 +39,11 @@ class TimesOnline(BasicNewsRecipe):
|
||||
'publisher': publisher,
|
||||
'language': language}
|
||||
|
||||
def classes(classes):
|
||||
q = frozenset(classes.split(' '))
|
||||
return dict(attrs={
|
||||
'class': lambda x: x and frozenset(x.split()).intersection(q)})
|
||||
|
||||
def get_browser(self):
|
||||
br = BasicNewsRecipe.get_browser(self)
|
||||
br.open('http://www.thetimes.co.uk/')
|
||||
@ -74,9 +79,9 @@ class TimesOnline(BasicNewsRecipe):
|
||||
cover = None
|
||||
return cover
|
||||
|
||||
remove_tags = [{
|
||||
'attrs': {'class': lambda x: x and 'is-hidden' in x.split()},
|
||||
'name': ['object', 'link', 'iframe', 'base', 'meta', 'script']}, {
|
||||
remove_tags = [
|
||||
classes('Topics is-hidden Tooltip Toolbar Comments RelatedLinks'),
|
||||
{'name': ['object', 'link', 'iframe', 'base', 'meta', 'script']}, {
|
||||
'attrs': {
|
||||
'class': [
|
||||
'tools comments-parent', 'u-hide', 'Tooltip',
|
||||
|
Loading…
x
Reference in New Issue
Block a user