1
0
Fork 0
mirror of https://github.com/EDeev/school_menu.git synced 2026-10-07 20:49:36 +03:00

get info from the site

This commit is contained in:
Egor Deev 2021-10-09 21:17:01 +07:00 • committed by GitHub
parent 23ba63f358
commit 55608acea3

View file

@ -1,4 +1,4 @@
from bs4 import BeautifulSoup from bs4 import BeautifulSoup as bf
import requests as req import requests as req
import datetime as dt import datetime as dt
import openpyxl, os import openpyxl, os
@ -13,7 +13,7 @@ def eating(day):
if wkd != 6: if wkd != 6:
try: try:
resp = req.get('http://school09.ru/vse-stati/main/food1').text resp = req.get('http://school09.ru/vse-stati/main/food1').text
soup = BeautifulSoup(resp, "html.parser").find_all("ul", "easyfolderlisting")[0] soup = bf(resp, "html.parser").find_all("ul", "easyfolderlisting")[0]
food = [[str(_)[15:32], str(_)[190:200], str(_)[130:172]] for _ in soup if _ != "\n"] food = [[str(_)[15:32], str(_)[190:200], str(_)[130:172]] for _ in soup if _ != "\n"]
if day == 0: if day == 0: