def get_electricity_info(self, apart_id, meter_room):
        """get electricity info

            :param apart_id: 栋数
            :param meter_room: 宿舍号
        """
        apart_id = str(apart_id)
        meter_room = str(meter_room)
        try:
            content = LifeService._get_electricity_info_html(apart_id, meter_room)
        except KeyError as e:
            _.d(e.message)
            result = {
                'response': None
            }
            return _.to_json_string(result)
        soup = BeautifulSoup(content)
        tags = soup.find_all(name='span', class_='STYLE7')
        result = {
            'response': {
                'apart': _.trim(tags[0].string),
                'apart_id': _.trim(tags[1].string),
                'used': _.trim(tags[2].string),
                'left': _.trim(tags[3].string),
                'update_time': _.trim(tags[4].string)
            }
        }
        return _.to_json_string(result)
def get_electricity_info ( self , apart_id , meter_room ) : apart_id = str ( apart_id ) meter_room = str ( meter_room ) try : content = LifeService . _get_electricity_info_html ( apart_id , meter_room ) except KeyError as e : _ . d ( e . message ) result = { 'response' : None } return _ . to_json_string ( result ) soup = BeautifulSoup ( content ) tags = soup . find_all ( name = 'span' , class_ = 'STYLE7' ) result = { 'response' : { 'apart' : _ . trim ( tags [ 0 ] . string ) , 'apart_id' : _ . trim ( tags [ 1 ] . string ) , 'used' : _ . trim ( tags [ 2 ] . string ) , 'left' : _ . trim ( tags [ 3 ] . string ) , 'update_time' : _ . trim ( tags [ 4 ] . string ) } } return _ . to_json_string ( result )
get electricity info

            :param apart_id: 栋数
            :param meter_room: 宿舍号