import requests
from bs4 import BeautifulSoup
from fake_useragent import UserAgent
ua = UserAgent()
def get_first_upload():
headers = {
"user-agent": f"{ua.random}"
}
url = "https://test-front.mangalib.me/ru?section=home-updates"
r = requests.get(url=url, headers=headers)
soup = BeautifulSoup(r.text, "lxml")
upload_cards = soup.find_all("div", class_="section-body w6_at")
for upload in upload_cards:
upload_title = upload.find("a", class_="w6_br").text.strip()
upload_desc = upload.find("span", class_="w6_lw").text.strip()
upload_url = f"https://test-front.mangalib.me{upload.find("div", class_="w6_gp").get("href")}"
print(f"{upload_title} | {upload_desc} | {upload_url}")
get_first_upload()
Process finished with exit code 0