|
|
@@ -22,19 +22,23 @@ RaceDay = collections.namedtuple('RaceDay', RaceDayShort._fields + (
|
|
|
Scratching = collections.namedtuple('Scratching', 'venue date race horse')
|
|
|
|
|
|
|
|
|
-def get_today_row(this_text):
|
|
|
+def get_today_row(this_text, this_row):
|
|
|
"""
|
|
|
Traverses the main table on the front page of https://racingaustralia.horse.
|
|
|
This function scrapes Venue information and race day information.
|
|
|
Unfortunately there is no clever way to split this function into two parts.
|
|
|
:param this_text:
|
|
|
+ :param this_row:
|
|
|
:return RaceDay this_race_day:
|
|
|
"""
|
|
|
this_soup = BeautifulSoup(this_text, 'html.parser')
|
|
|
rows = this_soup.select('tr.rows')
|
|
|
# print('len(rows) {}'.format(len(rows)))
|
|
|
all_race_days = []
|
|
|
- for day in range(len(rows)):
|
|
|
+ days_to_check = [this_row]
|
|
|
+ if this_row == 0:
|
|
|
+ days_to_check = range(len(rows))
|
|
|
+ for day in days_to_check:
|
|
|
my_row = rows[day]
|
|
|
cells = my_row.select('td')
|
|
|
i = 0
|