![]() |
#1 |
Connoisseur
![]() Posts: 85
Karma: 10
Join Date: Dec 2015
Device: Kindle
|
The Federalist Recipie repair
The current built-in recipe no longer works as the html class names have been changed. I find that there are now two different html codings being used, some articles use one and some use the other. In the attached revision to the built-in recipe file, I added classes to the keep_only_tags command that correspond to both of these two configurations (without removing the original classes) hence the command is lengthy. It seems to work well getting all of the article content with three exceptions that I do not know how to fix.
First, for some of the articles the main photo appears incorrectly at the end of the article in the mobi file. The source order of elements is title, byline, photo, photo caption, article body. Some articles appear this way in the output but some have the photo at the end. There are also some in-line photos and graphics and those appear properly in the output. Second, the 'Share' list in the left-side box of the source article is back in the output file as a bullet list just before the article body and should be removed. Third, the 'More Articles' buttons that appear below the source article appear as a second list in the output file after the article body and also should be removed. Thanks in advance. |
![]() |
![]() |
![]() |
#2 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,343
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Connoisseur
![]() Posts: 85
Karma: 10
Join Date: Dec 2015
Device: Kindle
|
Some articles missing lead photo and inline graphics, for example titled 'Propoganda Press.." and "We Knew Before...".
|
![]() |
![]() |
![]() |
#4 |
Connoisseur
![]() Posts: 85
Karma: 10
Join Date: Dec 2015
Device: Kindle
|
Added links to the example articles.
Some articles missing lead photo and inline graphics, for example titled Propoganda Press… and We Knew Before.... |
![]() |
![]() |
![]() |
#5 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,343
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Connoisseur
![]() Posts: 85
Karma: 10
Join Date: Dec 2015
Device: Kindle
|
Perfect - thanks.
As an aside, I often use the following to remove hyperlinks. Is there an easy way to format the affected text from which hyperlink was removed (perhaps with underlining) to leave a visible trace indicating that there is a link in the source document? def postprocess_html(self, soup, first_fetch): for a in soup.findAll('a', href=True): del a['href'] return soup |
![]() |
![]() |
![]() |
#7 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,343
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
a['style'] = 'text-decoration: underline'
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
The Federalist recipie no longer works | jma1 | Recipes | 2 | 10-22-2020 01:21 PM |
Request for new recipie The Federalist | jma1 | Recipes | 9 | 05-11-2018 12:37 PM |
History U.S. Founders: The Federalist Papers (PDF) | Last_of_the_PEs | Other Books | 0 | 05-25-2011 02:30 AM |
Government Publius: The Federalist Papers. eReader. 30 Jan 2008 | 6charlong | Other Books | 1 | 01-30-2008 04:52 PM |