@client.command()
async def online(ctx):
parse = "https://arizona-rp.com"
headers = {"User-Agent": "?)"}
page = requests.get(parse, headers = headers)
soup = BeautifulSoup(page.content, "html.parser")
servers_blocks = soup.select('#header > div > div.monitoring > div > div') # Выбираем все блоки с серверами
serveronline = '' # Создаем пустую строку
for server in servers_blocks:
serveronline += server.text.strip().replace('\n/ ','/')
serveronline +='\n########\n\n'
print(serveronline)
embed = discord.Embed(description = 'Мониторинг игровых серверов Arizona', color = random.choice(colors))
embed.add_field(name = f"`Онлайн серверов`", value = serveronline, inline = False)
await ctx.send(embed = embed)