Ejemplo n.º 1
0
 def __extract_match_data(self, category):
     link = self.link.replace("live-cricket-scores",
                              "live-cricket-scorecard")
     soup = Common.get_soup_object(link)
     if self.series is None:
         self.series = self.__extract_series_object(soup, category)
     self.format = Common.get_match_format(self.title, self.series.format)
     if self.format is not None:
         self.__extract_match_info(soup)
         if self.__is_valid() is True:
             self.__extract_teams(soup)
             self.__extract_teams_short_names()
             self.time = self.__get_match_time()
             self.is_valid = True
Ejemplo n.º 2
0
 def __validate_match(self, match_title_block, match_venue_block,
                      match_outcome, series_formats):
     is_valid = False
     match_format = None
     match_id = None
     match_link = None
     if (match_title_block is not None) and ("cricket-scores" in match_title_block.get('href')) and \
                 (match_venue_block is not None) and (match_outcome is not None):
         match_format = Common.get_match_format(match_title_block.text,
                                                series_formats)
         if match_format is not None:
             match_link = match_title_block.get('href')
             match_id = match_link.split("/")[2]
             if self.__db_match_table.check_match_id(match_id):
                 self.__logger.info(
                     "Skipping {}. Available in DB".format(match_id))
             else:
                 is_valid = True
     return [is_valid, match_id, match_link, match_format]