Files
Stan-Ansible/app/rules.py
T
2023-01-23 17:58:12 +03:00

14 lines
329 B
Python

from bs4 import BeautifulSoup
from urllib.request import urlopen
html = BeautifulSoup(urlopen('https://telegra.ph/pythonchatru-07-07'), 'lxml')
def get_rule(li):
li = int(li)
lis = html.find_all('li')
if li <= len(lis):
return lis[li - 1].text
else:
return f'Пока не придумали.'