Spaces:
Runtime error
Runtime error
File size: 368 Bytes
1337ed3 | 1 2 3 4 5 6 7 8 9 10 11 12 13 | 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')
|