import re with open('home_content.html', 'r', encoding='utf-8') as f: content = f.read() # 1. Update background color of section to #FFFFFF content = re.sub( r'(\.kmc-sixth-section\s*\{\s*background:\s*)#F8F7F3(;)', r'\1#FFFFFF\2', content ) # 2. Update the paragraph text old_text = r"As your coach and transformation partner, our results are driven by who you're being, not the tactics your doing\. Success demands total commitment to achieving the impossible\." new_text = r"Coaching is a partnership designed for growth — outcomes depend on commitment and context." content = re.sub(old_text, new_text, content) # 3. Update icons icon1 = '' icon2 = '' icon3 = '' # Find the three articles and replace their svgs articles = re.findall(r'(
)', content, flags=re.DOTALL) if len(articles) == 3: # Card 1 new_art1 = re.sub(r'', icon1, articles[0], count=1, flags=re.DOTALL) content = content.replace(articles[0], new_art1) # Card 2 new_art2 = re.sub(r'', icon2, articles[1], count=1, flags=re.DOTALL) content = content.replace(articles[1], new_art2) # Card 3 new_art3 = re.sub(r'', icon3, articles[2], count=1, flags=re.DOTALL) content = content.replace(articles[2], new_art3) else: print(f"Error: Found {len(articles)} articles instead of 3!") with open('home_content.html', 'w', encoding='utf-8') as f: f.write(content) print("Updated home_content.html")