def parse_row_date(s): return sbc.parse_bl_date(s)[0]
def get_row_date(s): return sbc.parse_bl_date(s)
tests_data = {} for iframe in soup.find_all('iframe'): iframe_url = iframe['src'] d = sc.download(iframe_url, silent=True) d = d.replace('\n', ' ') # Taegliche PCR-Tests BL data = sc.find( r'<pre id="data[^"]*".*?> ?Datum,"Negative Tests","Positive Tests"\s*([^<]+)</pre>', d) if data: for row in data.split(" "): c = row.split(',') date = sbc.parse_bl_date(c[0])[0] if date not in tests_data: tests_data[date] = create_bs_test_data(date) tests_data[date].negative_tests = round(float(c[1])) tests_data[date].positive_tests = round(float(c[2])) continue # Taegliche Positivitaetsrate BL data = sc.find( r'<pre id="data[^"]*".*?> ?Datum,"T.gliche Positivit.tsrate BL"\s*([^<]+)</pre>', d) if data: for row in data.split(" "): c = row.split(',') date = sbc.parse_bl_date(c[0])[0] if date not in tests_data: