From c8853eb1a53d0c905de2952183b203f4a0f43e9b Mon Sep 17 00:00:00 2001 From: def <8384198-dettlaff@users.noreply.gitlab.com> Date: Wed, 1 Dec 2021 20:45:39 +0000 Subject: [PATCH] =?UTF-8?q?=D0=97=D0=B0=D0=B3=D1=80=D1=83=D0=B7=D0=B8?= =?UTF-8?q?=D1=82=D1=8C=20=D0=BD=D0=BE=D0=B2=D1=8B=D0=B9=20=D1=84=D0=B0?= =?UTF-8?q?=D0=B9=D0=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- soup/idioto.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 soup/idioto.py diff --git a/soup/idioto.py b/soup/idioto.py new file mode 100644 index 0000000..4eb1dc9 --- /dev/null +++ b/soup/idioto.py @@ -0,0 +1,26 @@ +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) + "'")