From c6d39ee5799c2a8a6864b97a60fb91dfd4806844 Mon Sep 17 00:00:00 2001 From: Johannes Rothe Date: Wed, 23 Feb 2022 21:50:54 +0100 Subject: [PATCH] Add missing requirement and set locale to German --- README.md | 5 ++--- scrape.py | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index f237898..0bffcbb 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,3 @@ -# scraperoog +# Requirements -`apt install python3-pydantic python3-httpx python3-bs4 locales-all` -`sudo locale-gen` +`apt install python3-pydantic python3-httpx python3-bs4 python3-tqdm locales-all && sudo locale-gen` diff --git a/scrape.py b/scrape.py index e1f47b5..83fa807 100644 --- a/scrape.py +++ b/scrape.py @@ -2,6 +2,7 @@ import asyncio import csv import json import locale +locale.setlocale(locale.LC_TIME, "German") # dates on that page are German import pickle import platform from configparser import ConfigParser @@ -74,7 +75,6 @@ def generate_csv(result: Result) -> None: def convert_to_datestring(day: str, month: str, year: str) -> datetime: - locale.setlocale(locale.LC_TIME, "") date = datetime.strptime(f"{day.zfill(2)} {month} {year}", "%d %B %Y") return date