Quote:
Originally Posted by nook.life
|
Try this:
Code:
from calibre.web.feeds.news import BasicNewsRecipe
from calibre.ebooks.BeautifulSoup import BeautifulSoup
class Explosm(BasicNewsRecipe):
title = 'Explosm'
__author__ = 'Starson17'
description = 'Explosm'
language = 'en'
use_embedded_content= False
no_stylesheets = True
linearize_tables = True
oldest_article = 24
remove_javascript = True
remove_empty_feeds = True
max_articles_per_feed = 10
feeds = [
(u'Explosm Feed', u'http://feeds.feedburner.com/Explosm')
]
def get_article_url(self, article):
return article.get('link', None)
keep_only_tags = [dict(name='div', attrs={'id':'maincontent'})]
def preprocess_html(self, soup):
table_tags = soup.findAll('table')
table_tags[1].extract()
NavTag = soup.find(text='« First')
NavTag.parent.parent.extract()
return soup
extra_css = '''
h1{font-family:Arial,Helvetica,sans-serif; font-weight:bold;font-size:large;}
h2{font-family:Arial,Helvetica,sans-serif; font-weight:normal;font-size:small;}
p{font-family:Arial,Helvetica,sans-serif;font-size:small;}
body{font-family:Helvetica,Arial,sans-serif;font-size:small;}
'''