소스 검색

Switch to beautifulsoup findAll from select

Foppe Hemminga 6 년 전
부모
커밋
0da9eb5519
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      _bs.py

+ 2 - 2
_bs.py

@@ -166,13 +166,13 @@ def process_scratchings(this_data, this_venue):
         return
     scratchings_count = this_scr.select('table')[0].select('tr')[2].select('td')[3].getText()
     # print('{}: scratchings_count {}'.format(this_venue.name, scratchings_count))
-    header = this_scr.select('h3', text=re.compile('Scratchings'))[0]
+    header = this_scr.findAll('h3', text=re.compile('Scratchings'))[0]
     div = header.findNext('table')
 
     scratchings = set()
     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.findAll('h3', text=re.compile('Late Scratchings'))[0]
     late_div = header.findNext('table')
     late_scratchings = scrape_scratchings(late_div, this_venue)
     if this_venue.name == 'Corowa':