tobby48 5 gadus atpakaļ
vecāks
revīzija
c96aee2d8a

+ 3
- 1
src/main/python/kr/co/swh/lecture/opensource/html/schoolFood.py Parādīt failu

@@ -10,5 +10,7 @@ while True:
10 10
     soup = BeautifulSoup(html, 'html.parser')  # html.parser를 사용해서 soup에 넣겠다
11 11
     for day in soup.select('div[class="dayBox"]'):
12 12
         print(day.select('span')[0].text)
13
-        print(day.select('div[class="content"] div[class="tabContent on"] a')[0].text.strip())
13
+        yy = day.select('div[class="content"] div[class="tabContent on"] a')
14
+        if len(yy) > 0:
15
+            print(yy[0].text.strip())
14 16
         print("---------------------")