#! /usr/bin/env python3 # -*- coding: UTF-8 -*- import requests from bs4 import BeautifulSoup import datetime import json import re jvsCalUrl = "https://judoverbandsachsen.de/kalender/?show=all" def parseJvsCal(url=jvsCalUrl, minYear = 0, minMonth = 0, onlyWithAks=False): ''' Parse the calender page of the jvs returns dictionary of dictionaries of list cal[year][month] = listOfUrls ''' jvsCalPage = requests.get(url) jvsCalSoup = BeautifulSoup(jvsCalPage.content, "html.parser") jvsCalEventListItems = jvsCalSoup.find(id="eventListItems") jvsCalEventMonts = jvsCalEventListItems.find_all("div", class_="month") jvsWkList = {} for m in jvsCalEventMonts: if m.has_attr("data-month"): yearMonth = m.get("data-month") year = int(yearMonth[0:4]) if year < minYear: continue if not year in jvsWkList: jvsWkList[year] = {} month = int(yearMonth[4:6]) if year==minYear and month