|
@@ -0,0 +1,14 @@
|
|
1
|
+# https://irongaea.github.io/2018/07/29/bs4-select/
|
|
2
|
+import requests
|
|
3
|
+from bs4 import BeautifulSoup # BeautifulSoup import
|
|
4
|
+
|
|
5
|
+while True:
|
|
6
|
+ yearmon = input("증포중학교 년월: (ex.201904)")
|
|
7
|
+ url = 'http://www.jpo.ms.kr/lunch.list?ym=' + yearmon
|
|
8
|
+ response = requests.get(url)
|
|
9
|
+ html = response.text
|
|
10
|
+ soup = BeautifulSoup(html, 'html.parser') # html.parser를 사용해서 soup에 넣겠다
|
|
11
|
+ for day in soup.select('div[class="dayBox"]'):
|
|
12
|
+ print(day.select('span')[0].text)
|
|
13
|
+ print(day.select('div[class="content"] div[class="tabContent on"] a')[0].text.strip())
|
|
14
|
+ print("---------------------")
|