class Betcity(Bookmaker): def __init__(self): super(Betcity, self).__init__() self.url = 'http://betsbc.com/bets/bets.php' self.manager = BetcityManager() def parse_header(self, bg): self.cur_header = None header = self.manager.create_header(bg) return header def found_header(self, ph): self.cur_header = ph #print ''.join(ph.bet_pos.keys()) def parse_event(self, e): if self.cur_header is None: return None event = self.manager.create_event(self.cur_header, e) return event def found_event(self, pe): #pass print ''.join(pe.objs_ids.keys()) def get_html(self): br = self.open_connection() br.select_form(name='bets') # пока не выбираем долгосрочные ставки checkboxes = br.find_control(name='line_id[]').items for ch in checkboxes: ch.selected = True response = br.submit() return response.read() def get_bet_groups(self, soup): return soup.select('body > table') def get_bet_group_events(self, bg): return bg.select('#line')
def __init__(self): super(Betcity, self).__init__() self.url = 'http://betsbc.com/bets/bets.php' self.manager = BetcityManager()