diff --git a/brancheneinstufung.py b/brancheneinstufung.py index fd043810..02532a25 100644 --- a/brancheneinstufung.py +++ b/brancheneinstufung.py @@ -123,13 +123,14 @@ def get_wikipedia_data(name, website_hint=""): # Titelprüfung verbessern if any(x in page.title.lower() for x in ["krankenkasse", "versicherung"]): continue + html = requests.get(url).text if website_hint: - if website_hint.lower().split(".")[0] not in html.lower(): + domain_fragment = website_hint.lower().split(".")[0] + if domain_fragment not in html.lower(): continue if name.lower().split()[0] not in page.title.lower(): continue url = page.url - html = requests.get(url).text soup = BeautifulSoup(html, 'html.parser') infobox = soup.find("table", class_=["infobox", "infobox vcard"]) if not infobox: