with open('/workspace/ecommerce_research_sources/index.html', 'r', encoding='utf-8') as f: html = f.read() import re # Replace inline script with external scripts pattern = r'\n ' new_html = re.sub(pattern, replacement, html, flags=re.DOTALL) with open('/workspace/ecommerce_research_sources/index.html', 'w', encoding='utf-8') as f: f.write(new_html) print("index.html updated with clean external scripts.")