I know it is my 1st post, but believe me I had done my homework searching/reading as many posts/pages that I could to solve it by myself unsuccessfully. Last resort is asking for help...
So I am trying to write a recipe that downloads articles from Microwave Journal website
and convert it to ebook. Like NYT, MWJ also needs user/pass (which is Free, BTW). And also it has RSS site. To login, it sends you to another site
With the above foreword, I wrote the following recipe:
__license__ = 'GPL v3'
title = u'Microwave Journal'
oldest_article = 30
max_articles_per_feed = 100
auto_cleanup = True
no_stylesheets = True
language = 'en'
feeds = [(u'Current Issue', u'http://www.mwjournal.com/rss/Rss.asp?type=99')]
needs_subscription = True
br = BasicNewsRecipe.get_browser()
if self.username is not None and self.password is not None:
br.select_form(nr = 0)
br['EMAIL_ADDRESS'] = self.username
br['PASSWORD'] = self.password
br.form.find_control(name='remember_me',type="checkbox").get(nr=0).selected = True
I got "nr = 0" by inspecting the html file for the login page (the 1st FORM is for username/password). I also did check Remember me box (and tested unchecked too). Anyway, still when the epub is made, the site doesn't consider the user to be logged in (yes! I checked username password to be correct).
I added two attachments. ePub showing the final result (not logged in) and TXT showing ebook-convert output (I manually deleted user/password, otherwise there were there correctly).
Any help would be highly appreciated.
PS. omeda.com hosts other magazines as well which I searched recipes online repository
to see if any of those magazines are already there to reuse the code, but I found none.