View Single Post
Old 08-22-2013, 07:07 AM   #2
ds92
Junior Member
ds92 began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Aug 2013
Device: kindle
The guys froms calibre in the api documentation say that you have to use this code in your recipe for logging in for subscription based rss (they exemplify this with the new york times) .

Can someone integrate one of these two codes with dilemaveche recipe please?


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.nytimes.com/auth/login')
br.select_form(name='login')
br['USERID'] = self.username
br['PASSWORD'] = self.password
br.submit()
return br


OR


def javascript_login(self, browser, username, password):
browser.visit('http://some-page-that-has-a-login')
form = browser.select_form(nr=0) # Select the first form on the page
form['username'] = username
form['password'] = password
browser.submit(timeout=120) # Submit the form and wait at most two minutes for loading to complete


for javascript login
ds92 is offline   Reply With Quote