|
@@ -170,15 +170,15 @@ def process_scratchings(this_data, this_venue):
|
|
|
header = this_scr.select('h3', text=re.compile('Scratchings'))[0]
|
|
header = this_scr.select('h3', text=re.compile('Scratchings'))[0]
|
|
|
div = header.findNext('table')
|
|
div = header.findNext('table')
|
|
|
|
|
|
|
|
- scratchings = []
|
|
|
|
|
|
|
+ scratchings = set()
|
|
|
early_scratchings = scrape_scratchings(div, this_venue)
|
|
early_scratchings = scrape_scratchings(div, this_venue)
|
|
|
|
|
+ scratchings.update(early_scratchings)
|
|
|
header = this_scr.select('h3', text=re.compile('Late Scratchings'))[0]
|
|
header = this_scr.select('h3', text=re.compile('Late Scratchings'))[0]
|
|
|
div = header.findNext('table')
|
|
div = header.findNext('table')
|
|
|
late_scratchings = scrape_scratchings(div, this_venue)
|
|
late_scratchings = scrape_scratchings(div, this_venue)
|
|
|
- scratchings = early_scratchings + late_scratchings
|
|
|
|
|
- # Make sure the scratchings list contains distinct entries
|
|
|
|
|
- scratchings = list(set(scratchings))
|
|
|
|
|
- # assert len(scratchings) == int(scratchings_count), 'len(scratchings) {} == scratchings_count {}'.format(
|
|
|
|
|
- # len(scratchings), scratchings_count)
|
|
|
|
|
|
|
+ scratchings.update(late_scratchings)
|
|
|
|
|
+
|
|
|
|
|
+ assert len(scratchings) == int(scratchings_count), 'len(scratchings) {} == scratchings_count {}'.format(
|
|
|
|
|
+ len(scratchings), scratchings_count)
|
|
|
# pprint(scratchings)
|
|
# pprint(scratchings)
|
|
|
return scratchings
|
|
return scratchings
|