From de4450173b287ebe71e416b54a7c013df2dd30e3 Mon Sep 17 00:00:00 2001 From: Jeniamakarchik Date: Fri, 10 Apr 2020 17:05:38 +0300 Subject: [PATCH] fix footer processing --- src/book.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/book.py b/src/book.py index 0fd7f4b..d86d5a1 100644 --- a/src/book.py +++ b/src/book.py @@ -495,6 +495,15 @@ class Book: self.images = imgs + def _process_footer(self): + """ + Function to process
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
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)