sdu_bkjws/__init__.py
def login(self):
        """
        登陆系统,返回一个requests的session对象

        :return: session with login cookies
        :rtype: requests.sessions.Session
        """
        if not hasattr(self, 'session'):
            self.last_connect = time.time()
            s = requests.session()
            s.get('http://bkjws.sdu.edu.cn')

            data = {
                'j_username': self.student_id,
                'j_password': self.password_md5
            }
            r6 = s.post('http://bkjws.sdu.edu.cn/b/ajaxLogin', headers={
                'user-agent': self._ua},
                data=data)
            if r6.text == '"success"':
                return s
            else:
                s.close()
                raise AuthFailure(r6.text)
def login(self):
        """
        登陆系统,返回一个requests的session对象

        :return: session with login cookies
        :rtype: requests.sessions.Session
        """
        if not hasattr(self, 'session'):
            self.last_connect = time.time()
            s = requests.session()
            s.get('http://bkjws.sdu.edu.cn')

            data = {
                'j_username': self.student_id,
                'j_password': self.password_md5
            }
            r6 = s.post('http://bkjws.sdu.edu.cn/b/ajaxLogin', headers={
                'user-agent': self._ua},
                data=data)
            if r6.text == '"success"':
                return s
            else:
                s.close()
                raise AuthFailure(r6.text)
def login ( self ) : if not hasattr ( self , 'session' ) : self . last_connect = time . time ( ) s = requests . session ( ) s . get ( 'http://bkjws.sdu.edu.cn' ) data = { 'j_username' : self . student_id , 'j_password' : self . password_md5 } r6 = s . post ( 'http://bkjws.sdu.edu.cn/b/ajaxLogin' , headers = { 'user-agent' : self . _ua } , data = data ) if r6 . text == '"success"' : return s else : s . close ( ) raise AuthFailure ( r6 . text )
登陆系统,返回一个requests的session对象

        :return: session with login cookies
        :rtype: requests.sessions.Session
登陆系统 返回一个requests的session对象