![]() |
#1 |
Member
![]() Posts: 11
Karma: 10
Join Date: Feb 2011
Device: Kindle 3
|
Questions About def get_browser(self)
Hi Everyone,
I'm trying to add login information for this website: http://www.rockawave.com/user/login I'm a little confused about using the following: Code:
def get_browser(self): br = BasicNewsRecipe.get_browser() 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 2) If it is the name of the control where do I put my userid in the script? Do I have to define self.username as my username? 3) Same question for 'PASSWORD' Thanks |
![]() |
![]() |
![]() |
#2 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,316
Karma: 27111242
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
1) The form control
2) self.username will be set automatically by the news download system based on what the user of the recipe has entered If you are downloading using ebook-convert from the command line then you have to sue --username and -ppassword Dont forget to set needs_subscription = True in your recipe |
![]() |
![]() |
Advert | |
|
![]() |
#3 | |
Member
![]() Posts: 11
Karma: 10
Join Date: Feb 2011
Device: Kindle 3
|
Thank you for the quick reply.
Quote:
Thanks |
|
![]() |
![]() |
![]() |
#4 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,316
Karma: 27111242
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
You dont enter it into the script, the user enters it into calibre and it is passed to the script. If you are making this script just for yourself, then dont use self.username, use the username directly
|
![]() |
![]() |
![]() |
#5 |
Member
![]() Posts: 11
Karma: 10
Join Date: Feb 2011
Device: Kindle 3
|
![]() |
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
FYI, if your login page has code that identifies the userid and possword form with a form name, like this:
Code:
<form name='whatever' Code:
br.select_form(name='whatever') Code:
br.select_form(nr=3) |
![]() |
![]() |
![]() |
#7 |
Member
![]() Posts: 11
Karma: 10
Join Date: Feb 2011
Device: Kindle 3
|
Thanks Starson17. I was able to figure that out after some extensive Google searching. I was going nuts trying to find the form name. I thought I was missing something. However
Code:
br.select_form(nr=2) |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Can get_browser (login, password) be used to get the RSS XML? | spedinfargo | Recipes | 1 | 02-03-2011 09:55 PM |
PRS-300 Two Questions | kpfeifle | Sony Reader | 4 | 09-14-2009 04:55 PM |
Two Questions | Ryuujin27 | Calibre | 5 | 05-11-2009 10:38 AM |
a few questions | Thetaeta | Which one should I buy? | 4 | 07-31-2008 11:15 PM |
A few questions | jotheman | HanLin eBook | 10 | 06-30-2008 11:54 PM |