Pārlūkot izejas kodu

Merge branch 'master' of https://git.fop.pe/Foppe/scratchings

Afwas [1337627 6 gadi atpakaļ
vecāks
revīzija
d2990925b6
2 mainītis faili ar 7 papildinājumiem un 7 dzēšanām
  1. 4 4
      _bs.py
  2. 3 3
      main.py

+ 4 - 4
_bs.py

@@ -85,10 +85,10 @@ def get_meta_data(this_data, this_venue):
     """
     this_soup = BeautifulSoup(this_data, 'html.parser')
     early = this_soup.select('div.large')
-    if early:
-        print(early.get_text())
+    # if early:
+    # print(early.get_text())
     if early and 'not currently available' in early.get_text():
-        print(early.get_text())
+        # print(early.get_text())
         return
     try:
         this_meta_data = this_soup.select('div.race-venue-bottom')[0].select('div.col2')[0]
@@ -134,7 +134,7 @@ def process_scratchings(this_data, this_venue):
     except IndexError:
         return
     scratchings_count = this_scr.select('table')[0].select('tr')[2].select('td')[3].getText()
-    print('{}: scratchings_count {}'.format(this_venue.name, scratchings_count))
+    # print('{}: scratchings_count {}'.format(this_venue.name, scratchings_count))
     header = this_scr.select('h3', text=re.compile('Scratchings'))[0]
     div = header.findNext('table')
     old_race = 0

+ 3 - 3
main.py

@@ -21,7 +21,7 @@ if __name__ == '__main__':
 
     race_days_global = model.scrape_main_page(row)
     interim = time.time()
-    print('interim 1 {}'.format(interim - start))
+    # print('interim 1 {}'.format(interim - start))
     # pprint(race_days_global)
     race_days = []
     raw_data_dict = {}
@@ -31,7 +31,7 @@ if __name__ == '__main__':
         race_days.append(race_day_details)
         raw_data_dict[race_day.name] = raw_data
     interim = time.time()
-    print('interim 2 {}'.format(interim - start))
+    # print('interim 2 {}'.format(interim - start))
     # pprint(race_days)
     cursor = db.cursor(cursor_factory=psycopg2.extras.NamedTupleCursor)
     for race_day in race_days:
@@ -81,4 +81,4 @@ if __name__ == '__main__':
     db.close()
 
     interim = time.time()
-    print('interim 3 {}'.format(interim - start))
+    # print('interim 3 {}'.format(interim - start))