diff --git a/RAAspotter_pref13.py b/RAAspotter_pref13.py index d8edba8a8cbb8a16fcccf4fcfc2c64f507c171ce..0285e12158fcaf26f0f117c4c5aeda29d6dd0011 100644 --- a/RAAspotter_pref13.py +++ b/RAAspotter_pref13.py @@ -42,8 +42,8 @@ class RAAspotter_pref13(RAAspotter): soup = BeautifulSoup(page_content, 'html.parser') # Pour chaque balise a, on regarde si c'est un PDF, et si oui on le parse - for a in soup.find_all('a', href=True, class_='fr-link--download'): - if a['href'].endswith('.pdf'): + for a in soup.select('a.fr-link.fr-link--download'): + if a.get('href') and a['href'].endswith('.pdf'): if a['href'].startswith('/'): url = f"{self.__HOST}{a['href']}" else: