import re import sys with open('tmp_home_current.html', 'r', encoding='utf-8') as f: html = f.read() # 1. Update Image old_img = """
Kevin McKeand
""" new_img = """
Kevin McKeand
""" if old_img in html: html = html.replace(old_img, new_img) else: print("Warning: could not find old_img") # 2. Update Credentials old_cred = """

Credentials

Confidential. Insightful. Practical.

""" new_cred = """

Credentials

Confidential. Insightful. Practical.

""" if old_cred in html: html = html.replace(old_cred, new_cred) else: print("Warning: could not find old_cred") # 3. Align Pricing and change 550 to 500 old_p1 = """

Initial Assessment

""" new_p1 = """

Initial Assessment

""" old_p2 = """

Coaching

$550 / hour

""" new_p2 = """

Coaching

$500 / hour

""" old_p3 = """

Coaching Package

""" new_p3 = """

Coaching Package

""" if old_p1 in html: html = html.replace(old_p1, new_p1) else: print("Warning: could not find old_p1") if old_p2 in html: html = html.replace(old_p2, new_p2) else: print("Warning: could not find old_p2") if old_p3 in html: html = html.replace(old_p3, new_p3) else: print("Warning: could not find old_p3") with open('tmp_home_current2.html', 'w', encoding='utf-8') as f: f.write(html) print("Done writing tmp_home_current2.html")