예제 #1
0
def parse_row_date(s):
    return sbc.parse_bl_date(s)[0]
예제 #2
0
def get_row_date(s):
    return sbc.parse_bl_date(s)
예제 #3
0
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,&quot;Negative Tests&quot;,&quot;Positive Tests&quot;\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,&quot;T.gliche Positivit.tsrate BL&quot;\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: