|
|
#1 |
|
Junior Member
![]() Posts: 1
Karma: 10
Join Date: Oct 2016
Device: Kindle
|
Subscription based recipe help!
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! Code:
#!/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')
Last edited by PeterT; 10-16-2016 at 04:02 PM. Reason: adding code tags to preserve indentations |
|
|
|
![]() |
| Tags |
| recipe, subscription |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| The Australian Subscription recipe broken | OzNick | Recipes | 2 | 11-10-2015 10:12 PM |
| The Australian Subscription recipe failing | rayh | Recipes | 2 | 05-28-2013 02:16 AM |
| New recipe for nrc•next (subscription version) | vdHummes | Recipes | 3 | 05-10-2013 12:14 PM |
| recipe for newspaper subscription www.nd.nl | NicoDeMus! | Recipes | 0 | 11-24-2011 06:02 PM |
| How to use recipe with subscription from command line | miwie | Calibre | 3 | 11-23-2010 05:10 AM |