From e5a3d98d190aff5df5822a3f5d5672469dd8c93c Mon Sep 17 00:00:00 2001 From: bootje Date: Mon, 20 Apr 2020 12:15:27 +0200 Subject: [PATCH] test --- website/same_words.html | 0 website/same_words.py | 182 ++++++++++++++++++++++++++++++++++++++ website/tag_comparison.py | 2 +- 3 files changed, 183 insertions(+), 1 deletion(-) create mode 100644 website/same_words.html create mode 100644 website/same_words.py diff --git a/website/same_words.html b/website/same_words.html new file mode 100644 index 0000000..e69de29 diff --git a/website/same_words.py b/website/same_words.py new file mode 100644 index 0000000..6bb090e --- /dev/null +++ b/website/same_words.py @@ -0,0 +1,182 @@ +# from termcolor import colored + +# read_file = 'this', 'Services', 'are', 'wrong', 'Services' +# l1 = ['Services'] +# formattedText = [] + +# for same_word in read_file: +# if same_word in l1: +# formattedText.append(colored(same_word,'white','on_red')) +# else: +# formattedText.append(same_word) + +# print(" ".join(formattedText)) + + + + + + +from termcolor import colored +from bs4 import BeautifulSoup + + +# file = open('tag_comparison.html', 'r') + +file = '''
+1 +. +Eligibility +You +must +be +at +least +13 +years +of +age +to +access +or +use +our +Services +. +If +you +are +under +18 +years +of +age +( +or +the +age +of +legal +majority +where +you +live +) +, +you +may +only +access +or +use +our +Services +under +the +supervision +of +a +parent +or +legal +guardian +who +agrees +to +be +bound +by +this +Agreement +. +If +you +are +a +parent +or +legal +guardian +of +a +user +under +the +age +of +18 +( +or +the +age +of +legal +majority +) +, +you +agree +to +be +fully +responsible +for +the +acts +or +omissions +of +such +user +in +connection +with +our +Services +. +If +you +are +accessing +or +using +our +Services +on +behalf +of +another +person +or +entity +, +you +represent +that +you +are +authorized
+''' + +#automation? +#find a same class +html = BeautifulSoup(file, 'html.parser') +my_divs = html.find_all('span', {'class': 'NN'}) + +print(my_divs) + + +for span in my_divs: + html.new_tag('css') + +add_group_color = html.new_tag('div') +add_group_color['class'] = 'add_group_color' +add_group_color['style'] = 'border-bottom: 2px solid red);' +my_divs.append(add_group_color) + +print(add_group_color) + + + + + diff --git a/website/tag_comparison.py b/website/tag_comparison.py index e3b7122..6819b69 100644 --- a/website/tag_comparison.py +++ b/website/tag_comparison.py @@ -253,7 +253,7 @@ print('') -#t_wrapper +#t_wrapper (second wrapper) print('
')