07-29-2024, 12:40 AM | #1 |
Zealot
Posts: 101
Karma: 10
Join Date: Sep 2020
Device: kindle paperwhite3/Oasis2
|
Get article link in preprocess_html()
Hi,
Is it possible to get the current article link in preprocess_html()? Thanks, Fei. |
07-29-2024, 01:21 AM | #2 |
creator of calibre
Posts: 44,546
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
No, use preprocess_raw_html for that. You can always convert it to soup with self.index_to_soup(raw). Just remember to return str(soup) at the end.
|
07-29-2024, 05:28 AM | #3 |
Zealot
Posts: 101
Karma: 10
Join Date: Sep 2020
Device: kindle paperwhite3/Oasis2
|
Thanks!
BTW, my recipe failed with reprocess_html replaced by preprocess_raw_html() until I realized preprocess_html was called after keep_only_tags and remove_tags while preprocess_raw_html was not. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Article link is hyperlinked into the text of every article of an RSS feed.. | unkn0wn | Recipes | 3 | 09-10-2021 03:50 AM |
parse_index for a jpg link as an article url | xiatian | Recipes | 2 | 12-01-2018 11:51 PM |
E-mail an article LINK to Kindle? | semicomatose | Amazon Kindle | 2 | 11-06-2015 03:10 PM |
Article object in preprocess_html | stuartweinstein | Recipes | 1 | 11-18-2010 12:53 PM |
Article link - How to beat Kindle... | kennyc | News | 6 | 09-08-2009 09:21 AM |