fix footer processing

This commit is contained in:
Jeniamakarchik
2020-04-10 17:05:38 +03:00
parent 9dea72ca31
commit de4450173b

View File

@@ -495,6 +495,15 @@ class Book:
self.images = imgs
def _process_footer(self):
"""
Function to process <div title="footer"> tags.
All the tags will be deleted from file.
"""
divs = self.body_tag.find_all('div', {'title': 'footer'})
for div in divs:
div.decompose()
def _process_div(self):
"""
Function to process <div> tags. All the tags will be deleted from file, all content of the tags will stay.
@@ -608,6 +617,7 @@ class Book:
self._process_images()
self.log(f'{len(self.images)} images have been processed.')
self._process_footer()
self._process_div()
self.content = self.body_tag.find_all(recursive=False)