diff --git a/requirements.txt b/requirements.txt index 71eba8d..653db6d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ beautifulsoup4==4.11.2 -thothlibrary==0.17.0 +thothlibrary==0.26.0 lxml==4.9.2 diff --git a/src/epublius/metadata.py b/src/epublius/metadata.py index 3064c24..c1ff846 100644 --- a/src/epublius/metadata.py +++ b/src/epublius/metadata.py @@ -128,13 +128,15 @@ def get_chapter_title(self): def get_chapter_doi(self): ''' - Retrieve chapter DOI based on the text of

+ Retrieve chapter DOI based on the text of

(this contains both copyright statement and DOI link) ''' # Not all chapters will have DOIs doi = None - doi_node = self.soup.find('p', class_='doi') + # Class string may not exactly match "doi" if an override has been implemented + # (e.g. `

`) + doi_node = self.soup.find('p', class_=lambda L: L and 'doi' in L.split()) if (doi_node is not None): # In the case where multiple elements are present,