import re with open('home_content.html', 'r') as f: content = f.read() # 1. Update H1 content = content.replace( '\n

Executive and Life Coaching to Achieve your Potential

', '\n

Executive and Life Coaching to Achieve your Potential

' ) # 2. Update H2 "Sample outcomes clients seek" content = content.replace( '\n

Sample outcomes clients seek

', '\n

Sample outcomes clients seek

' ) # 3. Move "Includes 4 hours of coaching" old_pricing_block = """

Includes 4 hours of coaching

Book Now
""" new_pricing_block = """
Book Now

Includes 4 hours of coaching

""" content = content.replace(old_pricing_block, new_pricing_block) # Also check Credentials title text, make it white content = content.replace( '\n

Credentials

', '\n

Credentials

' ) with open('home_content.html', 'w') as f: f.write(content)