from site

This commit is contained in:
Egor Deev 2021-10-09 21:22:26 +07:00 committed by GitHub
parent d098d1e627
commit 6d771232ed
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,4 +1,4 @@
from bs4 import BeautifulSoup as bf from bs4 import BeautifulSoup
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 = bf(resp, "html.parser").find_all("ul", "easyfolderlisting")[0] soup = BeautifulSoup(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: