diff --git a/Attrap_pref971.py b/Attrap_pref971.py index 556765f4e34e959c99e02e0f32869a05504a1cb5..0ada86e0fd234f86b8d63e625d135d803d5a8afb 100644 --- a/Attrap_pref971.py +++ b/Attrap_pref971.py @@ -117,10 +117,10 @@ class Attrap_pref971(Attrap): url = a["href"] url = unquote(url) - name = a.get_text() - date = datetime.datetime.strptime( - name.split("publié le ")[-1].strip().split('\n')[0], "%d %B %Y" - ) + + name = a.get_text().replace('Télécharger ', '').strip() + date_str = a.find_all('span')[-1].get_text().split(' - ')[-1].strip() + date = datetime.datetime.strptime(date_str, '%d/%m/%Y') raa = Attrap.RAA(url, date, name) elements.append(raa)