Files
railseek6/inspect_ui.py
2026-01-12 22:31:11 +08:00

16 lines
636 B
Python

import requests
from bs4 import BeautifulSoup
url = 'http://localhost:3015'
resp = requests.get(url)
print(resp.status_code)
if resp.status_code == 200:
soup = BeautifulSoup(resp.text, 'html.parser')
# Find all elements with class containing 'Select'
for tag in soup.find_all(class_=lambda c: c and 'Select' in c):
print(tag.name, tag.get('class'), tag.get('id'))
# Also find workspace selector
print('--- Workspace selector ---')
for tag in soup.find_all(['div', 'button', 'span']):
if 'workspace' in str(tag).lower():
print(tag.name, tag.get('class'), tag.get('id'), tag.text[:50])