diff --git a/.idea/22712.iml b/.idea/22712.iml
index 74d515a..9e6c4ca 100644
--- a/.idea/22712.iml
+++ b/.idea/22712.iml
@@ -4,7 +4,7 @@
-
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
index a971a2c..a6fa933 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -1,4 +1,4 @@
-
+
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index b89946a..4572841 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -4,7 +4,13 @@
-
+
+
+
+
+
+
+
@@ -33,12 +39,45 @@
+<<<<<<< HEAD
{
"keyToString": {
"last_opened_file_path": "C:/Users/Honor/c22712"
}
}
+=======
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+>>>>>>> d1c29f6 (телеграмм бот)
@@ -61,6 +100,27 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -84,6 +144,8 @@
+
+
@@ -147,7 +209,14 @@
1680206771744
-
+
+ 1680207517708
+
+
+
+ 1680207517708
+
+
diff --git a/Задания/task1/Prokhorova/dz.py b/Задания/task1/Prokhorova/dz.py
index 3f21c6b..2dfcb87 100644
--- a/Задания/task1/Prokhorova/dz.py
+++ b/Задания/task1/Prokhorova/dz.py
@@ -19,12 +19,20 @@ browser.get('https://www.ozon.ru/category/platya-zhenskie-7502/')
html_code = browser.page_source
soup = BeautifulSoup(html_code, 'lxml')
-name = soup.find_all('span', class_="m2e e3m m3e m5e tsBodyL k7l l7k")
+names = []
sale = soup.find_all('div', class_="eg1 g3e")
+
price = soup.find_all('span', class_="a2a-a2")
info = soup.find_all('span', class_="je4")
picture = soup.find_all('div', class_="k1m")
+products = soup.find_all("div", class_="k7o o7k")
+for product in products:
+ names.append(soup.find('span', class_="m2e e3m m3e m5e tsBodyL k7l l7k").text.strip())
+
+print(names)
+exit(0)
+
for i in range(20):
url = picture[i].find('img').attrs['src']
file_name = f"C:\\Users\\Honor\\Desktop\\учеба\\прога\\pictures\\{i}.jpg"
diff --git a/Задания/task1/Prokhorova/tgbot.py b/Задания/task1/Prokhorova/tgbot.py
new file mode 100644
index 0000000..6c10419
--- /dev/null
+++ b/Задания/task1/Prokhorova/tgbot.py
@@ -0,0 +1,37 @@
+import telebot
+import random
+from telebot import types
+
+f = open('C:\\Users\\Honor\\Desktop\\учеба\\прога\\тг_бот\\бот\\факт.txt', 'r', encoding='UTF-8')
+facts = f.read().split('\n')
+f.close()
+
+f = open('C:\\Users\\Honor\\Desktop\\учеба\\прога\\тг_бот\\бот\\поговорка.txt', 'r', encoding='UTF-8')
+thinks = f.read().split('\n')
+f.close()
+
+bot = telebot.TeleBot('5696445699:AAEPKQgUAs39DTLr_iyQvlaFAsJNFK8DMnc')
+
+@bot.message_handler(commands=["start"])
+def start(m, res=False):
+
+ markup=types.ReplyKeyboardMarkup(resize_keyboard=True)
+ item1=types.KeyboardButton("Факт")
+ item2=types.KeyboardButton("Поговорка")
+ markup.add(item1)
+ markup.add(item2)
+ bot.send_message(m.chat.id, 'Нажми: \nФакт'
+ ' для получения интересного факта\nПоговорка '
+ '— для получения мудрой цитаты ', reply_markup=markup)
+
+@bot.message_handler(content_types=["text"])
+def handle_text(message):
+ if message.text.strip() == 'Факт' :
+ answer = random.choice(facts)
+
+ elif message.text.strip() == 'Поговорка':
+ answer = random.choice(thinks)
+
+ bot.send_message(message.chat.id, answer)
+
+bot.polling(none_stop=True, interval=0)
\ No newline at end of file