This repository has been archived on 2022-09-12. You can view files and clone it, but cannot push or open issues or pull requests.
b-content/soup/idioto.py

27 lines
455 B
Python
Raw Normal View History

2021-12-01 20:45:39 +00:00
import requests
from bs4 import BeautifulSoup # pip install bs4, pip install lxml
import re
import os
url = 'ссылка для идиота'
response = requests.get(url)
soup = BeautifulSoup(response.text, 'lxml')
def string_cleanup(x, notwanted):
for item in notwanted:
x = re.sub(item, '', x)
return x
lol = (soup.get_text())
lol = lol.split()
lol = lol[0:3]
print(*lol)
os.system("notify-send 'ОЛО!' '" + str(lol) + "'")