2 840
ملف بوت تواصل مرتب
بلغة (php)
توكون سطر (5)
ايديك سطر (6)
اسمك سطر (7)
يوزر حسابك سطر (8)
ثم ارفع علي استضافتك
الملف تطوير زيزو الكومي
py : @ZYZO_ALCOMEY
ch : @Zecora0
26 Iyul 2024, 08:39
08 Apr 2025, ~11:58
from bs4 import BeautifulSoup
import requests
response = requests.get("https://www.aldiwan.net/random").content
soup = BeautifulSoup(response, 'html.parser')
title = soup.find('meta', {'property': 'og:title'})['content'].strip()
author = soup.find('meta', {'name': 'author'})['content'].strip()
poem = soup.find('div', {'id': 'poem_content'})
poem_ = [line.get_text().strip() for line in poem.find_all('h3')]
print("عنوان : ", title)
print("الشاعر : ", author)
print("الشعر : ")
for line in poem:
print(line)
@VIP3GL , @Python_Haider , @Zecora0
Ko'rish tajribangizni yaxshilash uchun cookie fayllaridan foydalanamiz.
«Hammasini qabul qilish» tugmasini bosib, siz cookie fayllaridan foydalanish siyosatiga rozilik bildirasiz.