Download frontend/debug_dashboard.py from PROSTLE/AarthiAI: direct link, hf CLI and curl.
- Browser
- Download file 1.25 kB
-
https://huggingface.co/spaces/PROSTLE/AarthiAI/resolve/main/frontend/debug_dashboard.py
- Command line
-
hf download hf://spaces/PROSTLE/AarthiAI/frontend/debug_dashboard.py
-
curl -L -o debug_dashboard.py https://huggingface.co/spaces/PROSTLE/AarthiAI/resolve/main/frontend/debug_dashboard.py
1.25 kB
| import traceback | |
| from playwright.sync_api import sync_playwright | |
| def run(): | |
| print("Starting playwright debugging...") | |
| with sync_playwright() as p: | |
| browser = p.chromium.launch(headless=True) | |
| page = browser.new_page() | |
| # Navigate to the local dashboard.html | |
| url = "file:///c:/Lang/stuf/StockSense-AI/frontend/dashboard.html" | |
| print(f"Loading {url}") | |
| page.goto(url) | |
| page.wait_for_timeout(3000) # Wait for animation | |
| # Take a screenshot to verify chart | |
| page.screenshot(path="c:/Lang/stuf/StockSense-AI/frontend/debug_screenshot.png") | |
| print("Debugging screenshot saved.") | |
| # Extract console logs if any errors existed | |
| # We can also execute a JS query to get chart values | |
| chart_points = page.evaluate('''() => { | |
| const chartData = window.Chart.instances[0]?.chart?.data?.datasets[0]?.data; | |
| const minScale = window.Chart.instances[0]?.chart?.scales?.y?.min; | |
| return {data: chartData, minScale}; | |
| }''') | |
| print(f"Chart debug data: {chart_points}") | |
| browser.close() | |
| if __name__ == "__main__": | |
| try: | |
| run() | |
| except Exception as e: | |
| traceback.print_exc() | |