diff --git a/recipes/sunday_times_magazine.recipe b/recipes/sunday_times_magazine.recipe index a5f9276e8d..6410df2c49 100644 --- a/recipes/sunday_times_magazine.recipe +++ b/recipes/sunday_times_magazine.recipe @@ -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',