Hi there,
I'm trying to create a recipe for an italian newspaper called "IlFoglio".
This is based on their RSS feed here:
http://www.ilfoglio.it/download/giornata/ilfoglio.rss
and attempts to login to the site (using my details)
http://www.ilfoglio.it/login.php
Is there any good soul out there able to help me on this?
Please note this is a variation of the built in recipe for this newspaper.
Thanks!
#!/usr/bin/env python2
# vim:fileencoding=utf-8
import string, re
from calibre import strftime
from calibre.web.feeds.recipes import BasicNewsRecipe
from calibre.ebooks.BeautifulSoup import BeautifulSoup
class Ilfoglio2(BasicNewsRecipe):
title = 'Ilfoglio'
__author__ = 'n3rts'
description = 'Daily news from the ilFoglio'
timefmt = ' [%a, %d %b, %Y]'
needs_subscription = True
no_stylesheets = True
def get_browser(self):
br = BasicNewsRecipe.get_browser(self)
if self.username is not None and self.password is not None:
br.open('http://www.ilfoglio.it/login.php')
br.select_form(name='login')
br['********@gmail.com'] = self.username
br['********'] = self.password
br.submit()
return br
def parse_index(self):
soup = self.index_to_soup('http://www.ilfoglio.it/home/index.htm')
I'm trying to create a recipe for an italian newspaper called "IlFoglio".
This is based on their RSS feed here:
http://www.ilfoglio.it/download/giornata/ilfoglio.rss
and attempts to login to the site (using my details)
http://www.ilfoglio.it/login.php
Is there any good soul out there able to help me on this?
Please note this is a variation of the built in recipe for this newspaper.
Thanks!
#!/usr/bin/env python2
# vim:fileencoding=utf-8
import string, re
from calibre import strftime
from calibre.web.feeds.recipes import BasicNewsRecipe
from calibre.ebooks.BeautifulSoup import BeautifulSoup
class Ilfoglio2(BasicNewsRecipe):
title = 'Ilfoglio'
__author__ = 'n3rts'
description = 'Daily news from the ilFoglio'
timefmt = ' [%a, %d %b, %Y]'
needs_subscription = True
no_stylesheets = True
def get_browser(self):
br = BasicNewsRecipe.get_browser(self)
if self.username is not None and self.password is not None:
br.open('http://www.ilfoglio.it/login.php')
br.select_form(name='login')
br['********@gmail.com'] = self.username
br['********'] = self.password
br.submit()
return br
def parse_index(self):
soup = self.index_to_soup('http://www.ilfoglio.it/home/index.htm')