From 31227c07f665e9ebdddca6d5da34564fe72fa042 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Kr=C3=BCger?= Date: Sun, 7 Feb 2021 23:38:21 +0100 Subject: [PATCH] beginn corona-stats script but my landkreis website is boring --- ...2021-02-07_Lagebericht_Corona-Homepage.pdf | 148 ++++++++++++++++++ corona_stats/run.py | 30 ++++ 2 files changed, 178 insertions(+) create mode 100644 corona_stats/2021-02-07_Lagebericht_Corona-Homepage.pdf create mode 100644 corona_stats/run.py diff --git a/corona_stats/2021-02-07_Lagebericht_Corona-Homepage.pdf b/corona_stats/2021-02-07_Lagebericht_Corona-Homepage.pdf new file mode 100644 index 0000000..5d68c1d --- /dev/null +++ b/corona_stats/2021-02-07_Lagebericht_Corona-Homepage.pdf @@ -0,0 +1,148 @@ + + + + + + + + + + + + + + + + + + + + + + + + + +Seite nicht gefunden + + + + + + +
+

Title

+ +
+
+ +
+ + + + +
+
+ + + + +
+ + + +
+ +
+ +
+ + + +
+
+ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/corona_stats/run.py b/corona_stats/run.py new file mode 100644 index 0000000..40d6915 --- /dev/null +++ b/corona_stats/run.py @@ -0,0 +1,30 @@ +import sys +import PyPDF2 +import pdfminer +import logging +import requests +import os +import os.path +import shutil +import urllib +import urllib.request +from datetime import date, timedelta +import re +import wget + +today = date.today() +url = 'http://covid19.barnim.de/fileadmin/portal/corona/Lagebericht/2021/' +url_notice = 'http://covid19.barnim.de/fileadmin/portal/corona/Lagebericht/2021/{0}_Lagebericht_Corona-Homepage.pdf'.format(today) +r = requests.get(url, allow_redirects=True) +pdf = open('{0}_Lagebericht_Corona-Homepage.pdf'.format(today), "r") + +print('Download Link: {0}'.format(url_notice)) + +print('Downloading ...') +if os.path.isfile('{0}_Lagebericht_Corona-Homepage.pdf'.format(today)): + print("File exist on local drive") +else: + open('{0}_Lagebericht_Corona-Homepage.pdf'.format(today), 'wb').write(r.content) + +print('opeing ...') +print(pdf.read())