Files
Unified_Dashboard_Suite_Go/scratch/examine_sections.py
T

18 lines
552 B
Python
Raw Normal View History

import json
import re
from urllib.parse import urlparse
with open("/home/creserver/Desktop/Vaishno_workspace/Jsons/credentials_23-10-2026.json") as f:
creds = json.load(f)
with open("web/docs/index.html") as f:
html = f.read()
m = re.search(r'<script id="api-data" type="application/json">(.*?)</script>', html, re.DOTALL)
data = json.loads(m.group(1))
# Let's inspect each section and see how eps can be grouped into APIs
print("Original sections:")
for s in data["sections"]:
print(f"- {s['id']}: {s['title']} ({len(s['eps'])} eps)")