From a8384f2f76b607635cefa337836f00fcf18edb6b Mon Sep 17 00:00:00 2001 From: NieThor Date: Mon, 17 Aug 2020 13:17:28 +0200 Subject: [PATCH] Added Spaces before and after lists --- VDE web scraper/scraper.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/VDE web scraper/scraper.py b/VDE web scraper/scraper.py index f33e9bf..bdad56c 100644 --- a/VDE web scraper/scraper.py +++ b/VDE web scraper/scraper.py @@ -102,11 +102,11 @@ def prettify_string_with_list(tag): ordered_lists = tag.find_all('ol') for u_list in unordered_lists: for li in u_list.find_all('li'): - li.string.replace_with(bullet + f' {li.string}') + li.string.replace_with(' ' + bullet + f' {li.string}') for o_list in ordered_lists: for i, li in enumerate(o_list.find_all('li')): - li.string.replace_with(str(i+1) + f'. {li.string}') + li.string.replace_with(' ' + str(i+1) + f'. {li.string}') return prettify_string(tag.get_text())