![]() |
#1 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 616
Karma: 85520
Join Date: May 2021
Device: kindle
|
The Hindu stopped working
https://github.com/kovidgoyal/calibr...s/hindu.recipe
in line 80 div = soup.find('section', attrs={'id': 'section_'}) change it to div = soup.find('section', attrs={'id': 'section_1'}) I changed it to _1 and it fetches article links from each section It loads the whole article text but it doesn't load images like before! looks like they changed that part too. This is the present code to fetch images (line 49) Code:
def preprocess_html(self, soup): img = soup.find('img', attrs={'class': 'lead-img'}) try: for i, source in enumerate(tuple(img.parent.findAll('source', srcset=True))): if i == 0: img['src'] = source['srcset'].split()[0] source.extract() except Exception: pass Code:
<img class="lead-img" src="https://www.thehindu.com/todays-paper/1cezy4/article65041871.ece/alternates/FREE_660/First-ever-wate%2BGSE9G8VFI.3.jpg.jpg" data-src-template="https://www.thehindu.com/todays-paper/1cezy4/article65041871.ece/alternates/FREE_660/First-ever-wate%2BGSE9G8VFI.3.jpg.jpg" data-original="https://www.thehindu.com/todays-paper/1cezy4/article65041871.ece/alternates/FREE_660/First-ever-wate%2BGSE9G8VFI.3.jpg.jpg" alt="Winged visitors making a splash at a lake in city.NAGARA GOPAL" title="Winged visitors making a splash at a lake in city.NAGARA GOPAL" data-device-variant="FREE~FREE~FREE~FREE" width="100%" height="100%"> Last edited by unkn0wn; 02-13-2022 at 01:28 AM. |
![]() |
![]() |
![]() |
#2 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,345
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 616
Karma: 85520
Join Date: May 2021
Device: kindle
|
images weirdly take up the whole page when reading on calibre ebook viewer. I've "object-fit: scale-down;" images so text should've adjusted around it, instead it takes up whole page even for smaller images.
Is there a short fix to this? this is from ebook viewer's element inspector. Code:
<img alt="Bitter pill?Punjab Congress chief Navjot Singh Sidhu campaigning in Amritsar on Wednesday.PTI-" class="lead-img" data-device-variant="FREE~FREE~FREE~FREE" data-original="https://www.thehindu.com/todays-paper/tp-national/7cq5pp/article65057516.ece/alternates/FREE_660/TH15-SANDEEP-Co%2BGHV9GLCQO.3.jpg.jpg" data-src-template="https://www.thehindu.com/todays-paper/tp-national/7cq5pp/article65057516.ece/alternates/FREE_660/TH15-SANDEEP-Co%2BGHV9GLCQO.3.jpg.jpg" src="images/img1_u17.jpg" title="Bitter pill?Punjab Congress chief Navjot Singh Sidhu campaigning in Amritsar on Wednesday.PTI-" data-calibre-src="feed_1/article_4/images/img1_u17.jpg" data-75fb396ca421354d3e6a262d-img-data="{"left":438,"right":846,"height":723,"display":""}" style="break-inside: avoid;"> Last edited by unkn0wn; 02-17-2022 at 02:58 AM. |
![]() |
![]() |
![]() |
#4 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,345
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Look at the styles view in the inspector and see where the css causing it is coming from
|
![]() |
![]() |
![]() |
#5 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 616
Karma: 85520
Join Date: May 2021
Device: kindle
|
Code:
.lead-img { height: 100%; width: 100%; } |
![]() |
![]() |
Advert | |
|
![]() |
#6 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,345
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
so add
.lead-img { height: auto !important } to extra_css in the recipe and it should befine. |
![]() |
![]() |
![]() |
#7 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,345
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
|
![]() |
![]() |
![]() |
#8 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 616
Karma: 85520
Join Date: May 2021
Device: kindle
|
Arre.. i just learned of this.. added remove attributes 'height' to the recipe, it worked.
and you already posted these changes. thanks. |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
The Hindu not Working! | kobofan | Recipes | 1 | 01-15-2021 01:25 AM |
"The Hindu" Fetch News Builtin Recipe Not Working | gids | Recipes | 1 | 01-13-2017 07:09 AM |
The HIndu not working. | pawan.kp | Recipes | 1 | 04-24-2013 03:30 PM |
IQ HELP MY IQ HAS STOPPED WORKING | Jaxie | PocketBook | 3 | 03-29-2012 04:57 PM |
Stopped working? | pshrynk | Calibre | 8 | 02-14-2009 04:43 PM |