device-pharmer.py
def resp_to_textboxes(self, target):
        ''' Find the first form on the page that has exactly 1 text box and 1 password box.
        Fill it out with the credentials the user provides. If no form is found, try
        authenticating with HTTP Basic Auth and if that also fails, try just getting a response. '''
        brtitle1 = None

        try:
            resp = self.br.open('%s' % target)
            try:
                brtitle1 = self.br.title()
            except Exception:
                brtitle1 = None
            forms = self.br.forms()
            self.br.form = self.find_password_form(forms)
            resp = self.fill_out_form()
            try:
                brtitle = self.br.title()
            except Exception:
                brtitle = None
        except Exception:
            # If trying to login via form, try basic auth
            try:
                resp, brtitle = self.resp_basic_auth(target)
            except Exception:
                # If basic auth failed as well, try no auth
                resp, brtitle = self.resp_no_auth(target)

        if brtitle == None and brtitle1:
            brtitle = brtitle1

        return resp, brtitle
 Find the first form on the page that has exactly 1 text box and 1 password box.
        Fill it out with the credentials the user provides. If no form is found, try
        authenticating with HTTP Basic Auth and if that also fails, try just getting a response. 
Find the first form on the page that has exactly 1 text box and 1 password box.
Fill it out with the credentials the user provides. If no form is found, try
authenticating with HTTP Basic Auth and if that also fails, try just getting a response.
Find the first form on the page that has exactly 1 text box and 1 password box . Fill it out with the credentials the user provides . If no form is found try authenticating with HTTP Basic Auth and if that also fails try just getting a response .
def resp_to_textboxes(self, target):
        brtitle1 = None
        try:
            resp = self.br.open('%s' % target)
            try:
                brtitle1 = self.br.title()
            except Exception:
                brtitle1 = None
            forms = self.br.forms()
            self.br.form = self.find_password_form(forms)
            resp = self.fill_out_form()
            try:
                brtitle = self.br.title()
            except Exception:
                brtitle = None
        except Exception:
            try:
                resp, brtitle = self.resp_basic_auth(target)
            except Exception:
                resp, brtitle = self.resp_no_auth(target)
        if brtitle == None and brtitle1:
            brtitle = brtitle1
        return resp, brtitle
def resp_to_textboxes ( self , target ) : brtitle1 = None try : resp = self . br . open ( '%s' % target ) try : brtitle1 = self . br . title ( ) except Exception : brtitle1 = None forms = self . br . forms ( ) self . br . form = self . find_password_form ( forms ) resp = self . fill_out_form ( ) try : brtitle = self . br . title ( ) except Exception : brtitle = None except Exception : try : resp , brtitle = self . resp_basic_auth ( target ) except Exception : resp , brtitle = self . resp_no_auth ( target ) if brtitle == None and brtitle1 : brtitle = brtitle1 return resp , brtitle
Find the first form on the page that has exactly 1 text box and 1 password box.
Find the first form on the page that has exactly 1 text box and 1 password box .
''' Find the first form on the page that has exactly 1 text box and 1 password box.
        Fill it out with the credentials the user provides. If no form is found, try
        authenticating with HTTP Basic Auth and if that also fails, try just getting a response. ''' # If trying to login via form, try basic auth # If basic auth failed as well, try no auth
self
target