|
|
#1 |
|
onlinenewsreader.net
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 334
Karma: 10143
Join Date: Dec 2009
Location: Kelowna BC
Device: Various
|
Washington Post news feed crash
The Washington Post RSS feeds have some issues which involve empty articles in the index, causing the parser to crash. I've opened a ticket, and in the mean time the following code added to the recipe will work around the issue.
Code:
def preprocess_html(self, soup):
for tag in soup.findAll('font'):
if tag['size']:
if tag['size'] == '+2':
if tag.b:
return soup
return None
|
|
|
|
|
|
#2 |
|
onlinenewsreader.net
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 334
Karma: 10143
Join Date: Dec 2009
Location: Kelowna BC
Device: Various
|
Kovid - thaks for the response to the ticket--since it is an XHTML defect in the Washington Post feed, perhaps you should put the workaround in the standard recipe (I've tested it and it works).
|
|
|
|
| Advert | |
|
|
|
|
#3 |
|
onlinenewsreader.net
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 334
Karma: 10143
Join Date: Dec 2009
Location: Kelowna BC
Device: Various
|
Actually, the following is safer since the test tag['size'] doesn't work if there is no attribute 'size'.
Code:
def preprocess_html(self, soup):
for tag in soup.findAll('font'):
if tag.has_key('size'):
if tag['size'] == '+2':
if tag.b:
return soup
return None
|
|
|
|
|
|
#4 |
|
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,631
Karma: 28549046
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
done.
|
|
|
|
![]() |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Two different formats on news feed | TonytheBookworm | Calibre | 3 | 10-06-2010 12:51 PM |
| News Feed Covers | DenverReader | Calibre | 4 | 02-06-2010 01:00 AM |
| News feed scheduling | nickredding | Calibre | 1 | 01-24-2010 08:28 PM |
| libprs500 News feeds Crash Reader | vinniet | Calibre | 17 | 12-02-2009 03:46 PM |
| News feed error | thibaulthalpern | Calibre | 4 | 03-22-2009 03:21 AM |