View Single Post
Old 06-02-2022, 12:39 AM   #6
unkn0wn
Guru
unkn0wn understands the Henderson-Hasselbalch Equation.unkn0wn understands the Henderson-Hasselbalch Equation.unkn0wn understands the Henderson-Hasselbalch Equation.unkn0wn understands the Henderson-Hasselbalch Equation.unkn0wn understands the Henderson-Hasselbalch Equation.unkn0wn understands the Henderson-Hasselbalch Equation.unkn0wn understands the Henderson-Hasselbalch Equation.unkn0wn understands the Henderson-Hasselbalch Equation.unkn0wn understands the Henderson-Hasselbalch Equation.unkn0wn understands the Henderson-Hasselbalch Equation.unkn0wn understands the Henderson-Hasselbalch Equation.
 
Posts: 625
Karma: 85520
Join Date: May 2021
Device: kindle
https://github.com/kovidgoyal/calibr...merican.recipe

scientific american cover and tags
line 14
Code:
keep_classes = {'article-header', 'article-content',
                'article-media', 'article-author', 'article-text', 
                'feature-article--header', 'feature-article--header-title', 
                'opinion-article__header-title', 'author-bio' }
remove_classes = {'aside-banner', 'moreToExplore', 'article-footer', 'flex-column--25', 'article-author__suggested'}
remove line 60 and add below lines after line 63 (there's better cover in issue page)
Code:
        select = Select(self.index_to_soup(url, as_tree=True))
        cover = [x.get('src', '') for x in select('main .product-detail__image img')][0].split('?')[0]
        self.cover_url = cover + '?w=800'

        feeds = []
the + '?w=800' is to reduce the size.. the actual image is like 8k resolution - 1mb file
and masthead_url = 'https://static.scientificamerican.com/sciam/assets/Image/newsletter/salogo.png'
unkn0wn is offline   Reply With Quote