- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
- 72
- 73
- 74
- 75
- 76
- 77
- 78
- 79
- 80
- 81
- 82
- 83
- 84
- 85
- 86
- 87
- 88
- 89
- 90
- 91
- 92
- 93
- 94
- 95
- 96
- 97
- 98
- 99
from lib2to3.pgen2 import token
import logging
import re
import requests
import pandas as pd
from bs4 import BeautifulSoup
from aiogram import Bot, Dispatcher, executor, types
from aiogram.dispatcher.filters import Text
bot = Bot(token="5243563589:AAHZL9JyJ0Q36dBpuXcjgzDuM-0n9OEWhpk")
dp = Dispatcher(bot)
logging.basicConfig(level=logging.INFO)
sso = "http://pinskgptklp.brest.by/sso.html"
pto = "http://pinskgptklp.brest.by/pto2.html"
logg = ""
response = requests.get(sso)
soup = BeautifulSoup(response.text, "lxml")
quotes = soup.find_all("tbody")
t = str(quotes)
arr = t.split('</tbody>, ')
stroka = arr[1]
stroki = stroka.split('<tr')
i = 1
j = 0
tablica = [0] 8
ttt = [[]] 8
tab1 = [0] len(stroki)
while i < len(tab1):
j = 0
tab1 = re.sub(r'\n+', '\n', stroki)
tab1 = re.sub(r'\<[^>]\>', '', "<" + stroki).split('\n')
while j < len(tab1):
if tab1[j] != "" and tab1[j] != "]":
logg += '|' + tab1[j]
j = j + 1
logg += '~'
i = i + 1
q = []
rem = logg.split('~')
o = 0
while o < len(rem):
q.append(rem.split('|'))
o = o + 1
o = 0
while o < len(rem):
o = o + 1
print(q)
sso_sh = q[4][1] + q[4][2] + q[4][3] + q[4][4] + '\n' + q[0][2] + " - " + q[4][5] + '\n' + q[0][3] + " - " + q[4][8]
sso_p = q[5][1] + q[5][2] + q[5][3] + q[5][4] + '\n' + q[0][2] + " - " + q[5][5] + '\n' + q[0][3] + " - " + q[5][8]
@dp.message_handler(commands="start")
async def cmd1(message: types.Message):
keyboard = types.InlineKeyboardMarkup()
keyboard.add(types.InlineKeyboardButton(text="ПТО", callback_data="n1"))
keyboard.add(types.InlineKeyboardButton(text="CCO", callback_data="n2"))
await message.answer("Действия:", reply_markup=keyboard)
#@dp.message_handler(Text(equals="Показать что-то"))
#async def cmd2(message: types.Message):
#await message.reply(stroki[1])
@dp.callback_query_handler(text="see")
async def see(call: types.CallbackQuery):
await call.message.answer("123123123")
await call.answer()
@dp.callback_query_handler(text="n1")
async def next(call: types.CallbackQuery):
keyboard = types.InlineKeyboardMarkup()
keyboard.add(types.InlineKeyboardButton(text=q[4][3], callback_data="pto1"))
keyboard.add(types.InlineKeyboardButton(text=q[5][3], callback_data="pto2"))
await call.message.answer("Что именно?", reply_markup=keyboard)
await call.answer()
@dp.callback_query_handler(text="n2")
async def next(call: types.CallbackQuery):
keyboard = types.InlineKeyboardMarkup()
keyboard.add(types.InlineKeyboardButton(text=q[4][3], callback_data="sso1"))
keyboard.add(types.InlineKeyboardButton(text=q[5][3], callback_data="sso2"))
await call.message.answer("Что именно?", reply_markup=keyboard)
await call.answer()
@dp.callback_query_handler(text="sso1")
async def next(call: types.CallbackQuery):
await call.message.answer(sso_sh)
Саб, нужна помощь с ботом, нужно сделать 2 часть с кнопкой ПТО, а то не получается спарсить
BOPEHHOE 24.02.2022 08:18 # 0
BOPEHHOE 24.02.2022 08:19 # 0
ucnaHckuu_CTblD 24.02.2022 14:49 # 0
Возможно, это код прошивки для штатного усилка какого-нибудь сабвуфера.
Steve_Brown 25.02.2022 19:25 # 0
Я без шуток не хожу
То ей что-то покажу
То "Что именно?" спрошу.