View Single Post
Old 02-18-2011, 09:38 AM   #1
mufc
Connoisseur
mufc doesn't littermufc doesn't litter
 
Posts: 99
Karma: 170
Join Date: Nov 2010
Location: Airdrie Alberta
Device: Sony 650
Failing UFC Feed

I have a recipe for the UFC that until this week worked fine. I have not changed anything but now the feed fails with this message.
TypeError('expected string or buffer',)
I can open the rss link in my browser. Any ideas ?
http://www.ufc.com/rss/news
Spoiler:
class AdvancedUserRecipe1290141997(BasicNewsRecipe):
title = u'UFC'
timefmt = ''
oldest_article = 7
max_articles_per_feed = 100

use_embedded_content = False
no_stylesheets = True

remove_javascript = True
extra_css = '''
h1{font-family:Georgia,serif; font-weight:bold;font-size:large;}
h2{font-family:Georgia,serif; font-weight:bold;font-size:large;}
p{font-family:Georgia,serif;font-size:small;}
body{font-family:Georgia,serif;font-size:small;}
'''

keep_only_tags =[dict(name='div', attrs={'class':'main-section'})]
remove_tags = [dict(name='div', attrs={'class':['active tab',' tab last','byline','comment-entry','bottom-comments','item-description ','media-item','intro']}),
dict(name='div', attrs={'id':['','',]}),
dict(name='img'),]


feeds = [(u'News', u'http://www.ufc.com/rss/news')]


def preprocess_html(self, soup):
for alink in soup.findAll('a'):
if alink.string is not None:
tstr = alink.string
alink.replaceWith(tstr)
return soup
mufc is offline   Reply With Quote