import re from bs4 import BeautifulSoup import json import os with open('/home/x79/.gemini/antigravity-ide/brain/53991324-2cf9-45f5-8177-0e9acab31498/.system_generated/steps/939/content.md', 'r') as f: html = f.read() soup = BeautifulSoup(html, 'html.parser') content = soup.find('div', class_='entry-content') if not content: print('entry-content not found.') exit(1) # we want to get the raw HTML string of the inner contents inner_html = "" for child in content.children: inner_html += str(child) # Let's save this raw HTML to a temp file with open('html_snippets/content_main_blocks/temp_agenda', 'w') as f: f.write(inner_html) print("Saved extracted HTML to temp_agenda. Length:", len(inner_html))