sahel-api / backend /scripts /check_frontend.py
Mohamed-20's picture
Deploy backend to HF Spaces
1337ed3
Raw
History Blame Contribute Delete
368 Bytes
import urllib.request
import re
r = urllib.request.urlopen('http://localhost:5173')
html = r.read().decode('utf-8', errors='replace')
scripts = re.findall(r'src="([^"]+\.(?:js|ts|jsx|tsx))"', html)
for s in scripts:
print(s)
idx = html.lower().find('error')
if idx >= 0:
print('\nError context:', html[max(0,idx-50):idx+100])
else:
print('No error found')