import re with open('home_content.html', 'r') as f: content = f.read() # 1. Update H1 content = content.replace( '\n
Includes 4 hours of coaching
""" new_pricing_block = """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( '\nCredentials
', '\nCredentials
' ) with open('home_content.html', 'w') as f: f.write(content)