View Single Post
Old 02-23-2011, 05:00 PM   #1
Finbar127
Member
Finbar127 began at the beginning.
 
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
1) Do I replace 'USERID' with my userid or with the name of the userid control on the form?

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
Finbar127 is offline   Reply With Quote