View Single Post
Old 07-14-2022, 01:15 PM   #1
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
economic times india update

https://github.com/kovidgoyal/calibr...s_india.recipe
feed based, remove_tags and preprocess images
Code:
remove_tags = [
        classes(
            'story_title storyCollection shareBar sr_widget_free jsSrWidgetFree srwidgetfree_3'
            ' sr_paid jsSrWidgetPaid ar_wrp arwd_ld_chk adBox custom_ad mgid orn_free_r bold'
        ),
    ]
Code:
    def preprocess_html(self, soup):
        for image in soup.findAll('img', attrs={'src': True}):
            image['src'] = image['src'].replace("width-300", "width-640")
        for img in soup.findAll('img', attrs={'data-original': True}):
            img['src'] = img['data-original'].replace('photo', 'thumb').replace('quality-100', 'quality-100,width-600,resizemode-4')
        return soup
add the bold part of above code to this print edition too.
https://github.com/kovidgoyal/calibr...edition.recipe
unkn0wn is offline   Reply With Quote