def user_id(self, user):
        ''' 
        Get userid from a name
        @return: id
        '''
        headers = {"Content-type": "application/x-www-form-urlencoded","Accept": "text/plain",'Referer': 'http://'+self.domain+'/team_news.phtml',"User-Agent": user_agent}
        req = self.session.get('http://'+self.domain+'/standings.phtml',headers=headers).content
        soup = BeautifulSoup(req)
        for i in soup.find('table',cellpadding=2).find_all('tr'):
            try:
                if (user == i.find_all('td')[2].text.encode('utf8')):
                    return  i.find('a')['href'].split('pid=')[1]
            except:
                continue
        return None
def user_id ( self , user ) : headers = { "Content-type" : "application/x-www-form-urlencoded" , "Accept" : "text/plain" , 'Referer' : 'http://' + self . domain + '/team_news.phtml' , "User-Agent" : user_agent } req = self . session . get ( 'http://' + self . domain + '/standings.phtml' , headers = headers ) . content soup = BeautifulSoup ( req ) for i in soup . find ( 'table' , cellpadding = 2 ) . find_all ( 'tr' ) : try : if ( user == i . find_all ( 'td' ) [ 2 ] . text . encode ( 'utf8' ) ) : return i . find ( 'a' ) [ 'href' ] . split ( 'pid=' ) [ 1 ] except : continue return None
Get userid from a name
        @return: id