get info from the site

This commit is contained in:
Egor Deev 2021-10-09 21:17:01 +07:00 committed by GitHub
parent 4954882c36
commit 82b8e713a0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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: