Example #1
0
class Marathon(Bookmaker):
    def __init__(self):
        super(Marathon, self).__init__()
        self.url = 'http://www.marathonbet.com/su/betting/all'
        self.manager = MarathonManager()

    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):
        html = urllib2.urlopen(self.url)
        return html

    def get_bet_groups(self, soup):
        return soup.select('#container_EVENTS > .main-block-events')

    def get_bet_group_events(self, bg):
        sel = bg.select('table.foot-market > tbody')
        return sel
Example #2
0
 def __init__(self):
     super(Marathon, self).__init__()
     self.url = 'http://www.marathonbet.com/su/betting/all'
     self.manager = MarathonManager()