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,
|
'publisher': publisher,
|
||||||
'language': language}
|
'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):
|
def get_browser(self):
|
||||||
br = BasicNewsRecipe.get_browser(self)
|
br = BasicNewsRecipe.get_browser(self)
|
||||||
br.open('http://www.thetimes.co.uk/')
|
br.open('http://www.thetimes.co.uk/')
|
||||||
@ -74,9 +79,9 @@ class TimesOnline(BasicNewsRecipe):
|
|||||||
cover = None
|
cover = None
|
||||||
return cover
|
return cover
|
||||||
|
|
||||||
remove_tags = [{
|
remove_tags = [
|
||||||
'attrs': {'class': lambda x: x and 'is-hidden' in x.split()},
|
classes('Topics is-hidden Tooltip Toolbar Comments RelatedLinks'),
|
||||||
'name': ['object', 'link', 'iframe', 'base', 'meta', 'script']}, {
|
{'name': ['object', 'link', 'iframe', 'base', 'meta', 'script']}, {
|
||||||
'attrs': {
|
'attrs': {
|
||||||
'class': [
|
'class': [
|
||||||
'tools comments-parent', 'u-hide', 'Tooltip',
|
'tools comments-parent', 'u-hide', 'Tooltip',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user