May 17, 2026, 11:40 PM
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
import requests
|
||||
from bs4 import BeautifulSoup
|
||||
from datetime import datetime, timedelta
|
||||
|
||||
# Definicja nazw miesięcy bez polskich znaków
|
||||
months = ["stycznia", "lutego", "marca", "kwietnia", "maja", "czerwca",
|
||||
"lipca", "sierpnia", "wrzesnia", "pazdziernika", "listopada", "grudnia"]
|
||||
|
||||
# Ustal datę początkową (1 stycznia bieżącego roku)
|
||||
start_date = datetime(datetime.now().year, 8, 1)
|
||||
|
||||
# Ustal datę końcową (31 marca bieżącego roku)
|
||||
end_date = datetime(datetime.now().year, 8, 1)
|
||||
|
||||
# Inicjalizacja daty do wyświetlania
|
||||
current_date = start_date
|
||||
|
||||
# Pętla wyświetlająca daty od początku roku do końca marca z nazwą miesiąca bez polskich znaków
|
||||
while current_date <= end_date:
|
||||
miesiac = current_date.strftime(f'{months[current_date.month - 1]}')
|
||||
dzien = current_date.day
|
||||
date = current_date.strftime(f'%Y-%m-%d')
|
||||
kalbi = "https://www.kalbi.pl/" + str(dzien) +"-"+miesiac
|
||||
print(kalbi)
|
||||
page = requests.get(kalbi)
|
||||
soup = BeautifulSoup(page.content, "html.parser")
|
||||
results = soup.find_all('section', class_='calCard-ententa')
|
||||
for result in results:
|
||||
links = result.find_all("a")
|
||||
for link in links:
|
||||
link_url = link["href"]
|
||||
print("Nietypowe:")
|
||||
print(link_url)
|
||||
print("<=")
|
||||
cytaty = soup.find_all('section', class_='calCard-quotes')
|
||||
|
||||
|
||||
|
||||
# end of program
|
||||
current_date += timedelta(days=1)
|
||||
|
||||
Reference in New Issue
Block a user