diff --git a/get-definitions.py b/get-definitions.py index b2ac47c..da1e56d 100644 --- a/get-definitions.py +++ b/get-definitions.py @@ -10,6 +10,7 @@ from requests import models BASE_URL = "https://www.cnrtl.fr/definition/" +CRIMINAL_SCUM = [] def main(): @@ -59,10 +60,11 @@ def get_definitions(form): if h2: title = str(h2.string).strip() if title == "Terme introuvable": + CRIMINAL_SCUM.append(form) links = contentbox("a") for link in links: alternative_form = str(link.string).strip() - if alternative_form == form: + if alternative_form in CRIMINAL_SCUM: continue get_definitions(alternative_form) elif title == "Erreur":